Learn R Programming

lawn (version 0.1.7)

lawn_sample: Return features from FeatureCollection at random

Description

Takes a data-FeatureCollection and returns a data-FeatureCollection with given number of features at random

Usage

lawn_sample(features = NULL, n = 100, lint = FALSE)

Arguments

features
A FeatureCollection
n
(integer) Number of features to generate
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 data functions: lawn_featurecollection, lawn_filter, lawn_linestring, lawn_point, lawn_polygon, lawn_random, lawn_remove

Examples

Run this code
lawn_sample(lawn_data$points_average, 1)
lawn_sample(lawn_data$points_average, 2)
lawn_sample(lawn_data$points_average, 3)

Run the code above in your browser using DataLab