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 ininput_dir. Only files matching the pattern will be loaded.- skip
Optional. A character string containing a
base::regular expression()to match files ininput_dirthat 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 classeemlist, containing a list ofeem. For more details seeeemR::eem_read().abs_dir_read()returns an object of classabslist, containing a list ofabs. For more details seeabs_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")
