generatePoints.RdGenerates a series of points based on an inhomogeneous Poisson process for random point generation.
generatePoints(x, npoints)a SpatRaster object representing intensity of the Poisson process.
An indication of the approximate number of points to be created. As it is based on a stochastic process, it indicates an average number of points to generate for the total area, distributed acordingly to the intensity 'x' but it rarely be exactly the number.
Returns a ppp object with a data frame containing the generated grid coordinates and values generated.
set.seed(1234)
# With default parameters
var <- generateVar(100, 100, 10, 1, 15)
#> [using unconditional Gaussian simulation]
# apply a logitic transformation to values
var$value <- logistic(var$value, 10, 1, 3)
rst <- rast(var, type="xyz")
pnt <- generatePoints(rst, 100000)
pnt
#> Planar point pattern: 99922 points
#> window: rectangle = [0.5, 100.5] x [0.5, 100.5] units
plot(rst)
points(pnt, cex=0.25)