Learn R Programming

lawn (version 0.1.7)

lawn_random: Generate random data

Description

Generates random data-GeoJSON data, including data-Point's and data-Polygon's, for testing and experimentation

Usage

lawn_random(type = "points", n = 10, bbox = NULL, num_vertices = NULL, max_radial_length = NULL)

Arguments

type
type of features desired: 'points' or 'polygons'
n
(integer) Number of features to generate
bbox
A bounding box inside of which geometries are placed. In the case of Point features, they are guaranteed to be within this bounds, while Polygon features have their centroid within the bounds.
num_vertices
Number options.vertices the number of vertices added to polygon features.
max_radial_length
Number 10 the total number of decimal degrees longitude or latitude that a polygon can extent outwards to from its center

Value

A data-FeatureCollection

See Also

Other data functions: lawn_featurecollection, lawn_filter, lawn_linestring, lawn_point, lawn_polygon, lawn_remove, lawn_sample

Examples

Run this code
## set of points
lawn_random(n = 2)
lawn_random(n = 10)
## set of polygons
lawn_random('polygons', 2)
lawn_random('polygons', 10)
# with options
lawn_random(bbox = c(-70, 40, -60, 60))
lawn_random(num_vertices = 5)

Run the code above in your browser using DataLab