absorbance_read: Reading absorbance data from txt and csv files.

Description Usage Arguments Details Value See Also Examples

View source: R/absorption_functions.R

Description

Reading absorbance data from txt and csv files.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
absorbance_read(
  absorbance_path,
  order = TRUE,
  recursive = TRUE,
  dec = NULL,
  sep = NULL,
  verbose = FALSE,
  cores = parallel::detectCores(logical = FALSE),
  ...
)

Arguments

absorbance_path

directory containing absorbance data files or path to single file. See details for format of absorbance data.

order

logical, data is ordered according to wavelength

recursive

read files recursive, include subfolders

dec

optional, either you set a decimal separator or the table is tested for . and ,

sep

optional, either you set a field separator or it is tried to be determined automatically

verbose

logical, provide more information

cores

number of CPU cores to be used simultanuously

...

additional arguments that are passed on to fread.

Details

If absorbance_path is a directory, contained files that end on "csv" or "txt" are passed on to read.table. If the path is a file, this file is read. Tables can either contain data from one sample or from several samples in columns. The first column is considered the wavelength column. A multi-sample file must have sample names as column names. All tables are combined to one with one wavelength column and one column for each sample containing the absorbance data. Column and decimal separators are guessed from the supplied data. In some cases, this can lead to strange results. Plaese set 'sep' and 'dec' manually if you encounter any problems.

Value

A data frame containing absorbance data. An attribute "location" contains the filenames where each sample was taken from.

See Also

fread

Examples

1
2
absorbance_path <- system.file("extdata", "absorbance", package = "staRdom")
absorbance <- absorbance_read(absorbance_path, verbose = TRUE, cores = 2)

staRdom documentation built on Oct. 8, 2021, 5:07 p.m.