Learn R Programming

lawn (version 0.1.7)

lawn_count: Count number of points within polygons

Description

Calculates the number of data-Point's that fall within the set of data-Polygon's

Usage

lawn_count(polygons, points, countField = "pt_count", lint = FALSE)

Arguments

polygons
Geojson polygons
points
Geojson points
countField
(character) A field to append to the attributes of the Polygon features representing Point counts
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

a data-FeatureCollection

See Also

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

Examples

Run this code
# using data in the package
cat(lawn_data$points_count)
cat(lawn_data$polygons_count)
lawn_count(polygons = lawn_data$polygons_count, points = lawn_data$points_count)

Run the code above in your browser using DataLab