Skip to contents

Generate a spatial point pattern within the simulation object's window using a Poisson point process.

Usage

GenerateSpatialPattern(
  sim_object,
  lambda = 25,
  ...,
  overwrite = FALSE,
  gridded = FALSE,
  grid_shift = 0.5
)

Arguments

sim_object

A 'SpatSimObj' containing a window.

lambda

The intensity of the point pattern Default is 25.

...

Additional arguments passed to 'rpoispp'.

overwrite

boolean indicating whether or not to replace point patterns if they exist in object

gridded

boolean value to whether or not simulate the point pattern in a grid. See details for more.

grid_shift

the amount to move alternative columns down when gridded; between -0.5 and 0.5

Value

The updated 'sim_object' with a simulated point process added to the 'Processes' slot.

Details

This function generates a spatial point process within the window of the 'sim_object' using a Poisson point pattern with intensity 'lambda'. The simulated point pattern is added to the 'Patterns' slot of the 'sim_object'. Additional arguments can be passed to the 'rpoispp' function.

The gridded parameter is used for simulating point patterns that would represent som spatial transcriptomic technologies such as visium, where rather than like cell being randomly distributed in a sample, the spots where data is measured is evenly spaced.

Examples

sim_object <- CreateSimulationObject()
#> No `window` specified - defaulting to x (0, 10); y (0, 10)
sim_object <- GenerateSpatialPattern(sim_object, lambda = 30)