Given vectors of longitudes, latitudes and values, this function will summarize given values by spatial polygon using the FUN and return a dataframe with polygon IDs and summary values.

summarizeByPolygon(
  longitude,
  latitude,
  value,
  SFDF,
  useBuffering = FALSE,
  FUN,
  varName = "summaryValue"
)

Arguments

longitude

vector of longitudes

latitude

vector of latitudes

value

vector of values at the locations of interest

SFDF

simple features data frame with polygons used for aggregating

useBuffering

passed to MazamaSpatialUtils::getSpatialData()

FUN

function to be applied while summarizing (e.g. mean, max, etc.)

varName

variable name assigned to the summary variable

Value

A dataframe with the same rows as `SFDF` but containing only two columns: `polygonID` and the summary value.

Note

This function has not been thoroughly tested and is included in the package for experimental use only.