readSLI | R Documentation |
read/write support for ENVI spectral libraries
readSLI(path)
path |
Path to spectral library file with ending .sli. |
ENVI spectral libraries consist of a binary data file (.sli) and a corresponding header (.hdr, or .sli.hdr) file.
The spectral libraries are read into a data.frame. The first column contains the wavelengths and the remaining columns contain the spectra.
writeSLI
## Example data
sliFile <- system.file("external/vegSpec.sli", package="RStoolbox")
sliTmpFile <- paste0(tempdir(),"/vegetationSpectra.sli")
## Read spectral library
sli <- readSLI(sliFile)
head(sli)
plot(sli[,1:2], col = "orange", type = "l")
lines(sli[,c(1,3)], col = "green")
## Write to binary spectral library
writeSLI(sli, path = sliTmpFile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.