Re: [R-sig-Geo] Count values "greater than" in rasterbrick layers

2014-09-02 Thread Robert J. Hijmans
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

Re: [R-sig-Geo] raster::extract fails on brick but works on individual layers of brick

2014-09-02 Thread Robert J. Hijmans
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

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