Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

randomCoordinates

Random or regularly distributed coordinates on the globe


Description

randomCoordinates returns a 'uniform random sample' in the sense that the probability that a point is drawn from any region is equal to the area of that region divided by the area of the entire sphere. This would not happen if you took a random uniform sample of longitude and latitude, as the sample would be biased towards the poles.

regularCoordiaates returns a set of coordinates that are regularly distributed on the globe.

Usage

randomCoordinates(n)
regularCoordinates(N)

Arguments

n

Sample size (number of points (coordinate pairs))

N

Number of 'parts' in which the earth is subdived )

Value

Matrix of lon/lat coordiantes

Author(s)

Robert Hijmans, based on code by Nils Haeck (regularCoordinates), http://mathforum.org/kb/message.jspa?messageID=3985660&tstart=0

and suggstions by Michael Orion (randomCoordinates), http://sci.tech-archive.net/Archive/sci.math/2005-09/msg04691.html

Examples

randomCoordinates(3)
regularCoordinates(1)

geosphere

Spherical Trigonometry

v1.5-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut], Ed Williams [ctb], Chris Vennes [ctb]
Initial release
2019-05-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.