Assuming I would have a raster in R like :
r <- raster(ncols=10, nrows=10)
r[] <- sample(50, 100, replace=T)
How could I set the values between [10,30] for example to NA?
I tried values = r[r<= c(10,30)] = NA
but this does not remove the values between 10 and 30.
Thanks in advance.