Can someone tell me why the following generates an error? The 'overlay' description in the 'raster' package suggests the single-layer object should recycle as needed...
Thanks! Kevin > r <- raster(ncol=10, nrow=10) > r <- init(r, fun=runif) > stack_r=stack(r,r) > overlay(stack_r,r,fun=sum) Error in function (classes, fdef, mtable) : unable to find an inherited method for function "overlay", for signature "RasterStack", "RasterLayer" Seems to me that the command above should be able to replicate: > stack_r+r class : RasterBrick filename : nlayers : 2 nrow : 10 ncol : 10 ncell : 100 projection : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 min value : 0.011 0.011 max value : 2 2 extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) resolution : 36, 18 (x, y) I need single-layer objects used as arguments within 'overlay' to recycle for more complex functions that include raster stacks... [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo