Alemante,

> but I keep on getting the message that CRS is wrong.
> Coordinate Reference System (CRS) arguments: NA

Please show more complete code. Which object are you talking about? Some of
the object you create have a CRS (SP) others do not.(pts, F1), which is
pretty obvious from reading the sequence of events in your code. You set
the CRS for SP, but then you use F1 again which does not have a CRS and
therefore neither do the objects derived from it. You could do
after, gridded(F1) = TRUE,  proj4string(F1) <- CRS("+proj=longlat")


> Could you please advice me on how I can get it right?

I need to guess, but I think you want to transform points, in that case, do
this:

# example data
x <- 1:10
y <- 1:10

F1<-data.frame(x, y)
library(sp)
SP <- SpatialPoints(F1,proj4string=CRS("+proj=longlat"))

library(rgdal)
spt <- spTransform(SP, CRS("  fill in  the proj4 string you want  ") )


Best, Robert


On Sat, Oct 6, 2012 at 5:48 AM, alemante zd <mintibezabih@gmail.com> wrote:

> Dear all,
>
> I would like to sp transform my latitude/longitude vector to by first
> telling it what CRS it is. This is what I did.
>
> F1<-data.frame(x, y)
> coordinates(F1)=~x+y
> SP<-SpatialPoints(F1,proj4string=CRS("+proj=longlat"))
> pts = SpatialPixels(SpatialPoints(F1))
> gridded(F1) = TRUE
>
> but I keep on getting the message that CRS is wrong.
> Coordinate Reference System (CRS) arguments: NA
>
> Could you please advice me on how I can get it right?
>
> cheers
> minti
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

