Revision 9e5b9bb8a0564f8bf629df4ca5e96d3078f50363 authored by jmc on 14 July 2008, 00:00:00 UTC, committed by Gabor Csardi on 14 July 2008, 00:00:00 UTC
1 parent a3b36b1
Raw File
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)
}
back to top