ChemoSpec in R - making spectra object from matrix

37 Views Asked by At

I am still having issues with loading the spectra object in R...

library(ChemoSpec)
FTIR<- read.csv(file="FTIR_20190328_test.csv", header = T)

matrix <- matrix2SpectraObject(
  gr.crit = c("ID"),
  gr.cols = c("auto"),
  freq.unit = "Wavelength",
  int.unit = "Absorbance intensity",
  descrip = "Treatment effects on necromass spectra",
  in.file = "FTIR_20190328_test.csv",
  out.file = "necro",
  chk = FALSE,
)

This is the error:

Reading 1 file(s)...

Assigning 0 spectra to 1 group(s)...
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  NAs introduced by coercion
2: In .groupNcolor(spectra, gr.crit, gr.cols, mode = "1D") :
  There was no match for gr.crit value ID among the file names.

Is this the object I want?

enter image description here

Here is what data looks like:

enter image description here

I'm not sure how to know if I properly loaded ChemoSpec matrix2SpectraObject correctly.

0

There are 0 best solutions below