randomCoordinates: Random or regularly distributed coordinates on the globe

Description Usage Arguments Value Author(s) Examples

View source: R/randomCoordinates.R

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

1
2

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

1
2

Example output

           lon       lat
[1,] 165.48456 -13.87911
[2,] 108.63600  74.99438
[3,] -43.28522 -11.38614
     lon lat
[1,]   0 -90
[2,]   0  90
[3,]   0   0
[4,]  90   0
[5,] 180   0
[6,] -90   0

geosphere documentation built on May 2, 2019, 5:16 p.m.