Skip to content
Prev 27867 / 29559 Next

indexing multi-layer rasters

Dear Ben,
Although I cannot answer your question on why logical subsetting was not 
implemented in package raster, there is a very easy workaround:
logo[[(1:nlayers(logo))[c(TRUE, TRUE, TRUE)]]]
logo[[(1:nlayers(logo))[c(TRUE, FALSE, TRUE)]]]

Also note that in case of lists '[[' does recursive indexing, and this 
type of logical indexing you are asking about works only with '['.
HTH,
?kos Bede-Fazekas
Hungarian Academy of Sciences

2020.01.16. 17:50 keltez?ssel, Ben Tupper ?rta: