Learn R Programming

ChemoSpec (version 1.48-4)

getManyCsv: Merge CSV Files in a Directory into a Spectra Object

Description

This function will read all .csv files in a directory, and use the file names to construct group membership and assign colors and symbols. All the data is placed into an object of S3 class "Spectra".

Usage

getManyCsv(gr.crit = NULL, gr.cols = c("auto"),
freq.unit = "no frequency unit provided",
int.unit = "no intensity unit provided",
descrip = "no description provided",
format = "csv", out.file = "mydata")

Arguments

Value

An unnamed object of S3 class Spectra will be written to out.file. To retrieve it, use new.name <- loadObject(out.file).

Rdversion

1.1

Warning

Files whose names are not matched using gr.crit are still incorporated into the "Spectra" object, but they are not assigned a group or color and therefore don't plot, though they do take up space in a plot! I will fix this eventually.

Details

The linking of groups with colors is handled by groupNcolor. getManyCsv acts on the files in the current working directory. These should be .csv files with the first column containing the frequency values and the second column containing the intensity values. The columns should be unlabeled. The frequency column is assumed to be the same in all .csv files. There should be no .csv files in the directory except those containing the data to be processed by getManyCsv, as all .csv files in the directory will be processed.

References

http://academic.depauw.edu/~hanson/ChemoSpec/ChemoSpec.html