lawn_deviation: Standard deviation of a field among points within polygons

View source: R/deviation.R

lawn_deviationR Documentation

Standard deviation of a field among points within polygons

Description

Calculates the population standard deviation (i.e. denominator = n, not n-1) of values from data-Point's within a set of data-Polygon's

Usage

lawn_deviation(
  polygons,
  points,
  in_field,
  out_field = "deviation",
  lint = FALSE
)

Arguments

polygons

Polygon(s) (data-FeatureCollection<(data-Polygon)>) defining area to aggregate

points

Points (data-FeatureCollection<(data-Point)>) with values to aggregate

in_field

Character for the name of the field on pts on which you wish to perform the aggregation.

out_field

Character for the name of the field on the output polygon FeatureCollection that will store the resultant value.

lint

(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

polygons with appended field representing deviation, as a data-FeatureCollection

Author(s)

Jeff Hollister hollister.jeff@epa.gov

See Also

Other aggregations: lawn_average(), lawn_collect(), lawn_count(), lawn_max(), lawn_median(), lawn_min(), lawn_sum(), lawn_variance()

Examples

## Not run: 
ex_polys <- lawn_data$polygons_aggregate
ex_pts <- lawn_data$points_aggregate
lawn_deviation(ex_polys, ex_pts, "population")

## End(Not run)

ropensci/lawn documentation built on May 18, 2022, 9:58 a.m.