[R] reprojrecting longitude from 0 - 360 to -180 - 180

John Wasige johnwasige at gmail.com
Tue Feb 3 19:06:44 CET 2015


Hello r community,

This is to request for help on how to reprojrect longitude from 0 - 360 to
-180 - 180
With the following script below, i get output transformed to something like
rectangle. Is there a better way of doing it?
### script
convert longitude from 0 - 360 to -180 - 180
library(raster)
rst <- raster('D:/prec/b1980p.tif')
rst <- raster(matrix(1:100, ncol=10), 0, 360, -90, 90, crs="+proj=merc")
r2 <- rotate(rst)
r2

Thanks for your help

John

	[[alternative HTML version deleted]]



More information about the R-help mailing list