View source: R/identify_area.R
identify_area | R Documentation |
This function takes a dataframe (with coordinate fields in decimal degrees), (optionally) a spatial object (either a shapefile, an sp::SpatialPolygonsDataframe, or an sf::polygon), and a field name from the polygon object. It then overlays the df with the polygon, and determines which discrete polygon contains each point from the df, and appends a new field containing this value. If no polygon is provided, the df will be assessed against NAFO subdivisions.
identify_area(
df = NULL,
lat.field = "LATITUDE",
lon.field = "LONGITUDE",
agg.poly.shp = NULL,
agg.poly.field = NULL,
flag.land = FALSE
)
df |
a dataframe to be analyzed. |
lat.field |
the default is |
lon.field |
the default is |
agg.poly.shp |
default is |
agg.poly.field |
default is |
flag.land |
default is |
a DataFrame with the column agg.poly.field
added
Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.