This already in your question:
"+init=epsg:4326"
That is equivalent to "+proj=longlat +ellps=WGS84" just looked up via the
EPSG code. A good site to explore this topic is spatialreference.org
On Saturday, May 19, 2012, Belay Gebregiorgis wrote:
> Hello everyone,
>
> I want to get a 1km by lkm grid raster image using my csv data. If I call
> latitude=a, longitude=b and preciptation=c.
>
> a<-(1,2,3,4,5)
> b<-(6,7,8,9,10)
> c<-(10,20, 30,40, 50)
>
> Then I found an example in r help which goes like
>
> pts = read.table("file.csv",......)
> library(sp)
> library(rgdal)
>
> proj4string(pts)=CRS("+init=epsg:4326") # set it to lat-long
> pts = spTransform(pts,CRS("insert your proj4 string here"))
> gridded(pts) = TRUE
> r = raster(pts)
> projection(r) = CRS("insert your proj4 string here")
>
> Because I am new to R, I have no idea what to put into the proj4 string and
> all that. Can anyone help me on this? If there is a different way of doing
> this, that is also fine.
>
> Kind Regards,
>
> Belay
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] <javascript:;> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: [email protected]
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.