spatial.to.ppp | R Documentation |
Spatstat point pattern objects consist of points and an observation windows.
This function uses a SpatialPoints
object and a SpatialPolygon
object to
generate the points and the window. Lastly, the ppp()
function is called to
create the ppp
object.
spatial.to.ppp(points, samplers)
points |
A |
samplers |
A |
A spatstat spatstat
ppp
object
if (require("spatstat.geom") &&
bru_safe_sp() &&
require("sp") &&
require("terra", quietly = TRUE) &&
require("sf", quietly = TRUE)) {
# Load Gorilla data
gorillas <- gorillas_sp()
# Use nest locations and survey boundary to create a spatstat ppp object
gp <- spatial.to.ppp(gorillas$nests, gorillas$boundary)
class(gp)
# Plot it
plot(gp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.