Nothing
#' Filter Points to a Region
#'
#' @param pts points with `sf` geometry to filter
#' @param shp shp to filter to
#' @param cond geometry subset to reduce shp to
#'
#' @return tibble with `sf` geometries
#' @export
#'
#' @examples
#' data(suffolk)
#' pts <- dots_points(suffolk, pop, divisor = 1000)
#' filter_pts(pts, suffolk, pop < 1000)
filter_pts <- function(pts, shp, cond = TRUE) {
shp <- shp[[attr(shp, 'sf_column')]][rlang::eval_tidy(rlang::enquo(cond), shp)]
rmapshaper::ms_clip(target = pts, clip = sf::st_as_sf(shp))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.