Skip to contents

This function updates the simulation window of a SpatSimObj by replacing the existing window with a new one.

Usage

UpdateSimulationWindow(sim_object, window = NULL)

Arguments

sim_object

A SpatSimObj object

window

A new owin object representing the updated simulation window

Value

The updated SpatSimObj object

Details

The UpdateSimulationWindow() function checks that the input sim_object is of class 'SpatSimObj', that the input window is not null and is of class 'owin'. If these checks pass, the function updates the simulation window in the input sim_object and returns the updated SpatSimObj object.

Examples

# Create a simulation object
sim_obj <- CreateSimulationObject()
#> No `window` specified - defaulting to x (0, 10); y (0, 10)

# Update the simulation window
new_window <- spatstat.geom::owin(c(0, 5), c(0, 5))
updated_sim_obj <- UpdateSimulationWindow(sim_obj, window = new_window)