Description Usage Arguments Value See Also Examples
View source: R/importSpectra.R
In case you have your spectra in separated files (.csv) this function imports and binds them in a single data frame. The files directory must contain only the samples files.
1 | importSpectra(path, sep = ";")
|
path |
A character vector with the full path to the data directory; by
default corresponds to the working directory, |
sep |
The field separator character; by default sep = ";". |
A data frame with the structure:
First column (WN): wave numbers of the spectra.
1-n: samples spectra (the column names correspond to the files names).
findPeaks
, gOverview
and
plotPeaks
1 2 3 4 5 6 7 8 9 10 11 12 | # Create an empty directory
# Now create some spectra separate files
A <- andurinhaData[, 1:2]
B <- andurinhaData[, c(1, 3)]
C <- andurinhaData[, c(1, 4)]
MASS::write.matrix(A, file = tempfile(pattern = "A.csv"), sep = ";")
MASS::write.matrix(A, file = tempfile(pattern = "B.csv"), sep = ";")
MASS::write.matrix(A, file = tempfile(pattern = "C.csv"), sep = ";")
# Try
importSpectra(path = paste0(tempdir(), "/"), ";")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.