occupied | R Documentation |
This function will return a facelayer
class object showing which faces are occupied by the input object.
occupied(gridObj, data, out = "logical", ...)
gridObj |
( |
data |
( |
out |
( |
... |
Arguments passed to the class specific methods |
This is a wrapper function on the OccupiedFaces
methods that are specific to grid class and input data.
The function Returns a facelayer
-class object.
# create a grid
g <- trigrid(8, sf=TRUE)
# create random points
randPoints <- rpsphere(100,output="polar")
# the faces occupied by these points
occ <- occupied(g, randPoints)
# plot using sf slot independently
plot(g@sf[occ,"geometry"])
points(randPoints, col="red", pch="+")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.