| randomPoints | R Documentation | 
This function generates random points in a terra::rast() object.
randomPoints(mask, n, prob = FALSE)
| mask | 
 | 
| n | 
 | 
| prob | 
 | 
base::matrix() with x-coordinates, y-coordinates, and
cell values.
This function is similar to dismo::randomPoints.
## Not run: 
# simulate data
sim_pus <- sim.pus(225L)
sim_spp <- sim.species(sim_pus, model = "normal", n = 1, res = 0.25)
# generate points
pts1 <- randomPoints(sim_spp, n = 5)
pts2 <- randomPoints(sim_spp, n = 5, prob = TRUE)
# plot points
plot(sim_spp)
points(pts1, col = "red")
points(pts2, col = "black")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.