which returns a RasterLayer with TRUE or FALSE. Cells with 1 are set to TRUE, all other cells, including NA are set to FALSE
Usage
which(x, arr.ind=FALSE)
Arguments
x
A RasterLayer object or a logical expression resulting in a RasterLayer object
arr.ind
Logical. If FALSE, a (logical) RasterLayer is returned, if TRUE, the cellnumbers are returned for which the condition is TRUE. Note that this behavior is somewhat different from the generic 'which' in the base packag