[R] mapproject returns NAs
Tobias Erik Reiners
Tobias.Reiners at bio.uni-giessen.de
Wed Sep 23 16:11:12 CEST 2009
Dear Helpers,
usually I try to find the answers on my own, but this one beated me.
I have to use the package Geneland which requires coordinates in
Lambert projection.
I have latitude and longitude (please copy to an .txt and read.table() )
X Y
3458231 5544356
3458263 5544301
3459143 5543274
3459205 5543209
3475184 5594707
3475215 5594842
3475381 5593977
3475397 5594442
3475428 5593959
3475441 5593989
3475766 5594891
3475770 5594318
3476000 5594992
3476001 5594722
3476004 5594804
3476004 5594811
3476018 5594090
3476032 5594038
3476035 5595077
3476053 5595027
3476055 5594986
3476057 5593827
3476059 5595031
3476078 5595063
3476091 5595050
When i try to use the function mapproject() i get "NA"s for some points
require("Geneland")
plot(coordinates,type="n",xlab="Lon",ylab="Lat",asp=1)
points(coordinates,col=2)
map(resol=0,add=TRUE)
coordinates
# convert to Lambert
mapproj.res <- mapproject(x=coordinates[,1],
y=coordinates[,2],
projection="lambert",
param=apply(unique(coordinates),2,mean))
coord.lamb <- cbind(mapproj.res$x,mapproj.res$y)
If anyone could explain me why this happens and hopefully tell me how
to solve it.
Thanks a lot in advance
Tobias
--
Tobias Erik Reiners
Justus Liebig University
IFZ - Department of Animal Ecology
Heinrich-Buff-Ring 26-32
D-35392 Giessen Germany
www.uni-giessen.de/cms/fbz/fb08/biologie/tsz/tieroekologie/mitarbeiter/diplomanden-innen/tobias-erik-reiners
More information about the R-help
mailing list