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.