Skip to content
Prev 19468 / 29559 Next

Error message in calc()

The problem, I think, is that there are NA values on your raster. You
have not considered the effect of NA values on what is returned by
fun1. You can fix fun1, but in this case I would do:

library(raster)
s <- stack(system.file("external/rlogo.grd", package="raster"))
s[1:10] <- NA

m <- max(s)
w <- which.max(s)

Robert
On Mon, Oct 7, 2013 at 2:29 AM, Eddie Smith <eddieatr at gmail.com> wrote: