Learn R Programming

glossa (version 1.0.0)

remove_points_polygon: Remove Points Inside or Outside a Polygon

Description

This function removes points from a dataframe based on their location relative to a specified polygon.

Usage

remove_points_polygon(
  df,
  polygon,
  overlapping = FALSE,
  coords = c("decimalLongitude", "decimalLatitude")
)

Value

A dataframe containing the filtered points.

Arguments

df

A dataframe object with rows representing points.

polygon

An sf polygon object defining the region for point removal.

overlapping

Logical indicating whether points overlapping the polygon should be removed (TRUE) or kept (FALSE).

coords

Character vector specifying the column names for longitude and latitude. Default is c("decimalLongitude", "decimalLatitude").