Import infrared spectra data into R by ChemoSpec package

Hello everyone. I am pretty new on R. Right now I am trying to analyse infrared spectra data in R with ChemoSpec package. So first I have to import spectra data , how ever I could not successfully do it. Here is my code:
install.packages("ChemoSpec")
library (ChemoSpec)

install.packages("R.utils")
library(R.utils)

setwd("C:\Users\TuJi\Documents\R\R softare analysis")
getwd()
spec<- matrix2SpectraObject(gr.crit = c("Bghinfected","Bghcontrol", "Bgtinfected","Bgtcontrol",
gr.cols = c("Col12"),
freq.unit = "wavenumber",
int.unit = "Absorbance intensity",
descrip = "powder mildew infection spectra",
in.file = "the path to my data in CSV format",
out.file = "Spec",
chk = FALSE
)

PM_Spetra <- loadObject("Spec.RData")

After run this code, it said:
PM_Spetra <- loadObject("Spec.RData")
Exception: Pathname not found: Spec.RData (no such file in the current working directory)

You give the value of out.file as Spec but then try to load Spec.Rdata. Are you sure that .Rdata is automatically appended to the file name?

Thank you for your reply. Later on I add path to the out.file and it did appeared in my working directory. However, it was not what I want because I could see the description of Spectra after I run this code was not correct.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.