Thiago,
Here are more direct approaches:
# generate raster data
r <- raster(ncol=384, nrow=190)
b <- brick(sapply(1:31, function(i) setValues(r, rnorm(ncell(r), i, 3
# sum up rain
acc.rain <- sum(b)
# count wet days
wet.days <- sum(b > 0)
or with calc
wet.days <- calc(b, function(x) sum(x
Frank,
I hope this issue has been solved in the development version.
install.packages("raster", repos="http://R-Forge.R-project.org";)
I would appreciate feedback.
Best, Robert
On Fri, Jul 25, 2014 at 12:40 PM, Frank Davenport
wrote:
> Sorry for the mutliple postings but I found another solution
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