MazamaSpatialUtils (version 0.6.4)

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, SPDF,
  useBuffering = FALSE, FUN, varName = "summaryValue")

Arguments

longitude

vector of longitudes

latitude

vector of latitudes

value

vector of values at the locations of interest

SPDF

SpatialPolygonsDataFrame 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 `SPDF@data` but containing only two columns: `polygonID` and the summary value.