Learn R Programming

inlabru (version 2.1.9)

spatial.to.ppp: Convert SpatialPoints and boundary polygon to spatstat ppp object

Description

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.

Usage

spatial.to.ppp(points, samplers)

Arguments

points

A SpatialPoints[DataFrame] object describing the point pattern.

samplers

A SpatialPolygons[DataFrame] object describing the observation window.

...

arguments passed on to predict

Value

A spatstat spatstat ppp object

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# Load Gorilla data

data("gorillas", package = "inlabru")

# 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)
# }

Run the code above in your browser using DataLab