An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070930/e4eeed8b/attachment.pl>
SpatialPoints problem
2 messages · Stoitchko Kalenderski, Johan Van de Wauw
On 9/30/07, Stoitchko Kalenderski <SKalenderski at eos.ubc.ca> wrote:
Hi All,
I am trying to create a grid but something getting wrong
here is the code
rm(list=ls())
library(maptools)
library(rgdal)
options("digits"=22)
lat=seq(from= -123.4, to= -121.4, length=20)
long=seq(from=48.95, to=49.5, length=10)
latitude cannot be <-90, that's why setting the projection string will fail. I guess you mixed up latitude and longitude!
#generates the grid
grd = expand.grid(lat,long)
sp_grd <- SpatialPoints(cbind(grd[,2],grd[,1]), proj4string=CRS("+proj=longlat +datum=WGS84"))
#do projection
spTransform(sp_grd,CRS("+proj=merc +datum=WGS84"))
any hint is appreciated
thx
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo