Group names extracted from filenames

Short fix for proper label on plots for group names extrated from filenames (with substr function). It is done with factor function that labels the levels of factors.

explosive<-substr(files, 1, 4)
explosive<-factor(explosive, levels=c ("C_4_", "PETN", "RDX_", "TNT_"), labels=c ("C-4", "PETN","RDX", "TNT"))
d1 = data.frame(files, explosive)
#create hyperSpec object
a1= new ("hyperSpec", wavelength = wavenumber, spc = spc, data=d1)
a1
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