lawn_collect | R Documentation |
Given an inProperty on points and an outProperty for polygons, this finds every point that lies within each polygon, collects the inProperty values from those points, and adds them as an array to outProperty on the polygon.
lawn_collect(polygons, points, in_field, out_field, lint = FALSE)
polygons |
a |
points |
a |
in_field |
(character) the field in input data to analyze |
out_field |
(character) the field in which to store results |
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: |
A FeatureCollection of data-Polygon features with
properties listed as out_field
Jeff Hollister hollister.jeff@epa.gov
Other aggregations:
lawn_average()
,
lawn_count()
,
lawn_deviation()
,
lawn_max()
,
lawn_median()
,
lawn_min()
,
lawn_sum()
,
lawn_variance()
ex_polys <- lawn_data$polygons_aggregate ex_pts <- lawn_data$points_aggregate res <- lawn_collect(ex_polys, ex_pts, 'population', 'stuff') res$type res$features res$features$properties ## Not run: lawn_collect(ex_polys, ex_pts, 'population', 'stuff') %>% view ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.