Learn R Programming

lawn (version 0.1.7)

lawn_deviation: 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(polys, pts, inField, outField, lint = FALSE)

Arguments

polys
Polygon(s) defining area to aggregate.
pts
Points with values to aggregate.
inField
Characater for the name of the field on pts on which you wish to perfrom the aggregation
outField
Characater for the name of the field on the ouput 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

See Also

Other aggregations: lawn_aggregate, lawn_average, lawn_count, lawn_max, lawn_median, lawn_min, lawn_sum, lawn_variance

Examples

Run this code
ex_polys <- lawn_data$polygons_aggregate
ex_pts <- lawn_data$points_aggregate
lawn_deviation(ex_polys, ex_pts, "population", "pop_sd")

Run the code above in your browser using DataLab