Skip to contents

Subset SpatRaster by wavelength range

Usage

hsi_subset_range(x, from, to, filename = "", overwrite = FALSE, ...)

Arguments

x

A SpatRaster with hyperspectral data. Band names must be numeric wavelengths in nm.

from

Numeric. Start wavelength of the range in nm, inclusive.

to

Numeric. End wavelength of the range in nm, inclusive.

filename

Character. Output filename. Default "" keeps result in memory.

overwrite

Logical. Overwrite existing file. Default FALSE.

...

Additional arguments passed to terra::writeRaster().

Value

A SpatRaster with all bands within the specified wavelength range.

Examples

if (FALSE) { # \dontrun{
x |> hsi_subset_range(from = 660, to = 680)

x |>
  hsi_smooth_savgol(m = 1) |>
  hsi_subset_range(from = 680, to = 750)
} # }