## generate the class:
library(sp)
library(rgdal)
data(afspec)
## get spatial coordinates:
sp <- afspec$samples[,c("Longitude","Latitude")]
coordinates(sp) <- ~Longitude+Latitude
proj4string(sp) <- CRS("+proj=longlat +datum=WGS84")
## prepare 'samples' table
samples <- cbind(afspec$samples["SAMPLEID"],
MID="AfSIS-MIR",
DateTime=Sys.time())
## convert to "SpectraPoints"
afspec.sp <- SpectraPoints(Spectra=Spectra(samples, afspec$ab), sp=sp)
summary(afspec.sp)
plot(afspec.sp@data)
data(m.PHIHOX)
Run the code above in your browser using DataLab