View source: R/rnd_locations.R
rnd_locations | R Documentation |
This function draws random locations in longlat format.
rnd_locations( nobs, xmin = -180, xmax = 180, ymin = -90, ymax = 90, output_type = c("data.table", "data.frame", "sf") )
nobs |
number of observations |
xmin |
minimum longitude |
xmax |
maximum longitude |
ymin |
minimum latitude |
ymax |
maximum latitude |
output_type |
type of output object. Either |
By default, this function draws a global sample of random locations. You can restrict it to a certain region via specifying xmin
, xmax
, ymin
,
and ymax
. The function draws from a uniform spatial distribution that assumes the planet to be a perfect sphere. The spherical assumption is common in GIS
functions, but deviates from Earth's exact shape.
Returns a data.table, data.frame, or sf object of unprojected (longlat) points.
data <- rnd_locations(1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.