Unfortunately as I dont have enough reputation (and cannot comment on that topic) I have to ask a simple question to an already existing problem. I was computing a raster mosaic in R and stuck to this process: How can I create raster mosaic using list of rasters? (Thanks a lot for that!).
My only problem is, that I want to compute it either using the median or mean but exluding my NAs. I am sorry but I didn't manage to include it into the existing code:
b1_listargs <- b1_unstack
b1_listargs$fun <- mean
b1_mosaic <- do.call(mosaic, b1_listargs)
As I understand the function from above it doesn't exclude NAs automatically. So given the mean
of c(4,4,4,4,NA)
my computed value would turn out to be NA
- that's not useful to me as an output...
Thanks for your help!