I have downloaded the 19 bioclimatic variables from Bioclim and I want to create a unique mask for all the 19 variables. The mask should exclude the pixels that have NA value in any of the 19 variables. This procedure is needed for further SDM analysis. I did this with a stack and worked, but it is not working for the Bioclim rasterBrick. In R:
library(raster
bioclim<-raster::getData('worldclim',var='bio', res=10)
s<-sum(bioclim)
MASK[!is.na(s)] <- 1
plot(MASK)