0

I have a problem, how to change the value of clouds that are red = 1, and not clouds = NA becomes clouds = NA and not clouds = 1

r1<-brick("001/110-05_2015001.ers")
ggRGB(r1,r=2,g=3,b=1,stretch = "lin")
cldmsk<- cloudMask(r1, blue = 1, tir = 5)
ggR(cldmsk, 2, geom_raster = TRUE)
cldmsk_final <- cloudMask(cldmsk, threshold = 0.5, buffer = 3)
ggRGB(r1,2,3,1, stretch = "lin") +ggR(cldmsk_final[[1]], ggLayer = TRUE, forceCat = TRUE, geom_raster = TRUE) +scale_fill_manual(values = "red", na.value = NA)
  • 1)You should start the script with a call to `library(pkgname)` to load the packages you are using. 2) Can you post sample data? Please edit **the question** with the output of `dput(df)`. Or, if it is too big with the output of `dput(head(df, 20))`. (`df` is the name of your dataset.) You seem to have 2 datasets, `r1` and `cldmsk`, `dput` just the one you need to process. – Rui Barradas Jun 18 '19 at 12:36
  • You should not use `dput` here. Look at examples in the raster package instead. Make this a reproducible example by either creating an object with data through code, or use a file that comes with the package. For example `r1 <- brick(system.file("external/rlogo.grd", package="raster"))`. Also show the packages you are using. – Robert Hijmans Jun 18 '19 at 12:58

0 Answers0