the function allows to automatically set to NoData eventual outliers present in a
raster single- or multi-band object (or file). For each band, quantiles of the distribution
of pixel values are computed using raster::quantile
, and the values falling outside the
limits set with the tails
argument are set to NoData in the output
cuttails_rast(in_rast, tails = c(0.02, 0.98), to_file = FALSE, verbose = TRUE)
in_rast |
|
---|---|
tails |
|
to_file | DESCRIPTION |
verbose | DESCRIPTION |
OUTPUT_DESCRIPTION
DETAILS
# on single band in_rast <- raster::raster(ncol=100, nrow=100) in_rast <- raster::setValues(in_rast, 1:10000) in_rast_cut <- cuttails_rast(in_rast) in_rast_cut#> class : RasterLayer #> dimensions : 100, 100, 10000 (nrow, ncol, ncell) #> resolution : 3.6, 1.8 (x, y) #> extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) #> coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 #> data source : in memory #> names : layer #> values : 201, 9800 (min, max) #>#> class : RasterStack #> dimensions : 100, 100, 10000, 3 (nrow, ncol, ncell, nlayers) #> resolution : 3.6, 1.8 (x, y) #> extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) #> coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 #> names : layer.1, layer.2, layer.3 #> min values : 1, 1, 1 #> max values : 10000, 10000, 10000 #>in_brick_cut <- cuttails_rast(in_brick) in_brick_cut#> class : RasterStack #> dimensions : 100, 100, 10000, 3 (nrow, ncol, ncell, nlayers) #> resolution : 3.6, 1.8 (x, y) #> extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) #> coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 #> names : layer.1, layer.2, layer.3 #> min values : 201, 201, 201 #> max values : 9800, 9800, 9800 #>