Dear members, I am very happily using the raster package but here is a problem I can't solve. When I use the mask function on a RasterBrick or RasterStack: raster_mask <- mask( raster_stack, SpatialPolygonDataFrame) raster returns a RasterLayer and gives me a warning: "In .rasterFromRasterFile(grdfile, band = band, objecttype) : size of values file does not match the number of cells (given the data type)" When I use mask on a single layer from a brick or stack (e.g. mask( RasterStack[1], SpatialPolygon*) ) it returns a correctly masked rasterlayer. I am trying to mask with a SpatialPolygonDataFrame, read in with readShapePoly of the maptools package. R version 2.13.0 (2011-04-13) Platform: x86_64-pc-mingw32/x64 (64-bit) I am sure I missed something simple and I hope someone would point it out to me. Thanks, Robert
Mask() in raster package only returns RasterLayers not RasterStack or RasterBrick
2 messages · Robert Buitenwerf, Robert J. Hijmans
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110927/de0e9e07/attachment.pl>