path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC08*.TIF"), full.names = TRUE)
sat <- satellite(files)
sat <- maskInvarFeatures(sat)
maskInvarFeatures(x = getSatDataLayer(sat, "B004n"),
nir = getSatDataLayer(sat, "B005n"),
swir = getSatDataLayer(sat, "B007n"))
## when dealing with a 'RasterStack'
rst <- stack(files[c(6, 7, 9)])
maskInvarFeatures(rst)
Run the code above in your browser using DataLab