Binary logical operations (5)

With binary predicate functions like st_intersects(), one can collect information about the topological relationship without making a spatially joined sf object (with sf::st_join()).

Example 1: counting points in polygons and adding the result to a copy of nc.

nc_points_2 <- st_sample(nc, size = 100)
## Warning in st_poly_sample(x, size = size, ..., type = type, by_polygon =
## by_polygon, : coordinate ranges not computed along great circles; install
## package lwgeom to get rid of this warning
## Warning in st_poly_sample(x, size = size, ..., type = type, by_polygon =
## by_polygon, : coordinate ranges not computed along great circles; install
## package lwgeom to get rid of this warning