randgeo (version 0.3.0)

rg_position: 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

Run this code
# NOT RUN {
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')
)
# }

Run the code above in your browser using DataLab