rg_position {randgeo}R Documentation

Random position

Description

Random position

Usage

rg_position(count = 1, bbox = NULL)

Arguments

count

(integer/numeric) number of positions. Default: 1

bbox

(integer/numeric) lat/long bounding box from which to generate positions; numeric vector of the form west (long), south (lat), east (long), north (lat). optional

Value

A list, each element is a numeric vector length two of long, lat

Examples

rg_position()
rg_position(10)
rg_position(100)
rg_position(bbox = c(50, 50, 60, 60))

# coerce to data.frame
stats::setNames(
  do.call("rbind.data.frame", rg_position(10)),
  c('lng', 'lat')
)

[Package randgeo version 0.3.0 Index]