Conditional command from Raster Calculator transfer to R
问题 So far I used the following statement in the Raster Calculator of ArcGIS: Con(("Land_use.rst" == -20), "Export.rst") This calculates a new Raster which only contains the Data from Export where Land_use equals -20. That is exactly what I want. But I want to automatise this in R , as I have to do it a lot of times. So far I got something like this: for (catch_dir in Dir_List) { r1 <- raster(paste0(catch_dir, '/Export.rst')) r2 <- raster(paste0(catch_dir,'/LAND_use.rst')) ### statement that