MazamaSpatialUtils (version 0.8.6)

summarizeByPolygon: Summarize values by polygon

Description

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.

Usage

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

Value

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

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