importSpectra: importSpectra

Description Usage Arguments Value See Also Examples

View source: R/importSpectra.R

Description

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.

Usage

1
importSpectra(path, sep = ";")

Arguments

path

A character vector with the full path to the data directory; by default corresponds to the working directory, getwd.

sep

The field separator character; by default sep = ";".

Value

A data frame with the structure:

See Also

findPeaks, gOverview and plotPeaks

Examples

 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(), "/"), ";")

andurinha documentation built on Aug. 13, 2020, 9:06 a.m.