rnd_locations {spaths} | R Documentation |
Random location drawing
Description
This function draws random unprojected (lonlat) locations.
Usage
rnd_locations(
nobs,
xmin = -180,
xmax = 180,
ymin = -90,
ymax = 90,
output_type = c("data.table", "data.frame", "SpatVector")
)
Arguments
nobs |
Number of observations |
xmin |
Minimum longitude |
xmax |
Maximum longitude |
ymin |
Minimum latitude |
ymax |
Maximum latitude |
output_type |
type of output object. Either |
Details
By default, the 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.
Value
Returns a data.table, data.frame, or SpatVector object of unprojected (lonlat) points.
Examples
rnd_locations(1000)
[Package spaths version 1.1.3 Index]