Re: [R-sig-Geo] Unexpected behavior of raster "mask" function

2014-09-02 Thread Alex Zvoleff
Thanks Robert! Exactly what I needed. Best, Alex On Sat, Aug 30, 2014 at 6:31 PM, Robert J. Hijmans wrote: > Alex, > Thanks for the clear example. I had not considered that case. > I have added an argument 'updateNA' to the mask function (version > 2.2-43) such that you can do: > > masked_imag

Re: [R-sig-Geo] Unexpected behavior of raster "mask" function

2014-08-30 Thread Robert J. Hijmans
Alex, Thanks for the clear example. I had not considered that case. I have added an argument 'updateNA' to the mask function (version 2.2-43) such that you can do: masked_image <- mask(img, msk, updatevalue=2, updateNA=TRUE) That is, if updateNA is TRUE, NA cells outside the mask are also updated

[R-sig-Geo] Unexpected behavior of raster "mask" function

2014-07-18 Thread Alex Zvoleff
I am using the mask function in the raster package (2.2-38) to mask out areas within an image that are outside an area of interest (AOI). There are NAs within this AOI that are meaningful - after masking the image I am using freq to tabulate these NAs along with the other values in my AOI. For this