importSpectra {andurinha}R Documentation

importSpectra

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

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

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


[Package andurinha version 0.0.2 Index]