# 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="+")
Run the code above in your browser using DataLab