Import ENVI file to R

Following code is used to import ENVI file to hyperSpec object.

wavenumbers1 <- unlist(read.table(pathtofiles1, quote="\"", comment.char=""))
spc1 <- read.ENVI (pathtofiles2, wavelength = wavenumbers1)
spc1sa$x<-as.numeric(spc1sa$x)
spc1sa$y<-as.numeric(spc1sa$y)

It uses read.ENVI function from the package hyperSpec, and converts x and y coordinates to numbers by using as.numeric function.

Krzysztof Banas
Krzysztof Banas
Principal Research Fellow

I work as beam-line scientist at Singapore Synchrotron Light Source. My research interests include application of advanced statistical methods for hyperspectral data processing (dimension reduction, clustering and identification).

Related