dear list members

i want to create a new raster where all cells that are NA in my 'mask' are
set to NA, but all other values stay the same as input rasters. instead of
NAs, masked areas are getting returned as 0s (see counts below). am i
missing a flag to set NAs?

thanks in advance,
j



r    <- raster(raster.asc)
m  <- raster(mask.asc)
mr <- mask(r, m)

> count (r, NA)
[1] 20533362
> count (m, NA)
[1] 39269328
> count (mr, NA)
[1] 20533362





-- 

*Jason MacKenzie, PhD*
*
Climate Change Adaptation Fellow*
The Nature Conservancy
201 Mission Street, 4th Floor
San Francisco, CA 94105
jmackenzie@tnc.org

(415) 281 0472            [work]
(415) 777 0244            [fax]
(510) 717 1544            [cell]
jasonbmackenzie        [skype]

	[[alternative HTML version deleted]]

