Dear Mohgli,

The function crop in the raster package is probably what you are looking 
for.

Happy Mapping,
Lionel

Le 24/05/2013 00:55, mohglimoor@gmail.com a écrit :
> Dear all
>
> I am plotting a raster dataset derived through a netCDF file and want to
> overlay with a shapfile. Although I specify the extent of the raster
> xmin=-180 to xmax=180 it puts the x values to 0 to 360. When I then do the
> overlay with a shapefile the shapefiles are shifted since the has an extent
> from -180 to 180.
>
> <ncid <- open.ncdf(FileNm)
> <
> <NetCDFRaster<-raster(FileNm, xmn=-180, xmx=180, ymn=-90, ymx=90,
> ncols=1440, nrows=400)
> <
> <plot(NetCDFRaster)
> <
> <testint <- mask(NetCDFRaster, Worldshapes)
>
> How can I adjust the raster extent to match the extent of the shapefile?
>
> Thanks for any support.
> Best regards,
> Mohgli
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


-- 
*HERTZOG* Lionel
2^nd year MSc Organismic Biology
s6lihert@uni-bonn.de <mailto:s6lihert@uni-bonn.de>
(+49)-0 15215149128

	[[alternative HTML version deleted]]

