swh:1:snp:a4c99a50dc49f82b591f268001b320f8c3ca0041
Tip revision: dc000f2a5f006d137f66716b086025d618bf8306 authored by John M Chambers on 14 July 2008, 00:00:00 UTC
version 1.0-5
version 1.0-5
Tip revision: dc000f2
geoXY.R
"geoXY" <-
function(latitude, longitude,
lat0 = min(latitude, na.rm=TRUE),
lon0 = min(longitude, na.rm=TRUE),
unit = 1.) {
lat0 <- rep(lat0, length(latitude))
lon0 <- rep(lon0, length(longitude))
yDist <- geoDist(lat0, lon0, latitude, lon0)
xDist <- geoDist(lat0, lon0, lat0, longitude)
cbind(X= xDist * sign(longitude - lon0)/unit,
Y = yDist * sign(latitude - lat0)/unit)
}