Skip to contents

Wrappers for eemR::eem_read() and abs_read() to read all EEMs or absorbance files in a directory into R, even when the directory contains other files.

Usage

eem_dir_read(
  input_dir,
  pattern = NA,
  skip = get_eem_skip(),
  file_ext = "dat",
  recursive = FALSE,
  import_function = "aqualog",
  verbose = TRUE
)

abs_dir_read(
  input_dir,
  pattern = NA,
  skip = get_abs_skip(),
  file_ext = "dat",
  recursive = FALSE,
  verbose = TRUE
)

Arguments

input_dir

Path to folder containing raw EEMs and/or absorbance files.

pattern

Optional. A character string containing a base::regular expression() to match files in input_dir. Only files matching the pattern will be loaded.

skip

Optional. A character string containing a base::regular expression() to match files in input_dir that should be ignored.

file_ext

The file extension of the EEMs or absorbance files.

recursive

Logical. Should the function recursively search directories?

import_function

Character or a user-defined function to import an EEM. For more details, see vignette("custom-indices").

verbose

Logical. Should the function return notes about resetting the readme file?

Value

  • eem_dir_read() returns an object of class eemlist, containing a list of eem. For more details see eemR::eem_read().

  • abs_dir_read() returns an object of class abslist, containing a list of abs. For more details see abs_read().

Examples

# Load all EEMs from directory
eem_list <- eem_dir_read(system.file("extdata", package = "eemanalyzeR"))
#> NOTE: removed previous 'readme' file

# Load all EEMs matching a pattern from directory
eem_list <- eem_dir_read(system.file("extdata", package = "eemanalyzeR"), pattern = "SEM")

# Load absorbance samples using a pattern
abs <- abs_dir_read(system.file("extdata", package = "eemanalyzeR"), pattern = "abs|ABS")

# Load absorbance samples while skipping EEMs and other files
abs <- abs_dir_read(system.file("extdata", package = "eemanalyzeR"), skip = "SEM|BEM|Waterfall")