iso_read_files: Core function to read isotope data files

Description Usage Arguments Value

View source: R/isoread.R

Description

This function takes care of extracting basic information about iso_files, dealing with problems and making sure only valid fire formats are processed. This function is not typically called directly but indirectly by calling iso_read_dual_inlet, iso_read_continuous_flow and iso_read_scan. It is made available outside the package because it can be very useful for testing new file readers.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
iso_read_files(
  paths,
  root,
  supported_extensions,
  data_structure,
  read_options = c(),
  reader_options = list(),
  discard_duplicates = TRUE,
  cache_files_with_errors = TRUE,
  parallel = FALSE,
  parallel_plan = future::multisession,
  parallel_cores = future::availableCores(),
  cache = default(cache),
  read_cache = default(cache),
  reread_outdated_cache = FALSE,
  quiet = default(quiet)
)

Arguments

paths

one or multiple file/folder paths. All files must have a supported file extension. All folders are expanded and searched for files with supported file extensions (which are then included in the read). Paths can be absolute paths or relative to the provided file root (which is the current working directory by default). For absolute paths, a common root directory will be guessed using iso_find_absolute_path_roots. The root portion of paths will never be displayed in info messages.

root

root directory for the isofiles. Can be relative to the current working directory (e.g. "data") or an absolute path on the file system (e.g. "/Users/..." or "C:/Data/.."). The default is the current working directory ("."). Can be supplied as a vector of same length as the provided paths if the paths have different roots.

supported_extensions

data frame with supported extensions and corresponding reader functions (columns 'extension', 'func', 'cacheable')

data_structure

the basic data structure for the type of iso_file

read_options

vector of read options to be stored in the data structure (e.g. c(read_vendor_data_table = FALSE)). The read_ prefix is optional.

reader_options

list of parameters to be passed on to the reader

discard_duplicates

whether to automatically discard files with duplicate file IDs (i.e. duplicate file names). If TRUE (the default), only the first files are kept and any files with the same file ID are discarded. If FALSE, all duplicate files are kept but their file IDs are appended with suffix #1, #2, etc.

cache_files_with_errors

deprecated. Please use iso_reread_problem_files instead to selectively re-read all files in a collection of iso files that had been previously read with errors or warnings.

parallel

whether to process in parallel based on the number of available CPU cores. This may yield performance increases for files that are slow to parse such as continuous flow isodat files but usually provides little benefit for efficient data formats such as reading from R Data Archives.

parallel_plan

which parallel processing strategy to use, see plan, typically future::multisession for compatibility with RStudio interactive mode. If supported by the operating system and running in detached mode (not interactively in RStudio) can also use future::multicore.

parallel_cores

how many processor cores to use for parallel processing. By default the maximum available number of cores (availableCores), which will allow maximal processing speed but may slow other programs running on your machine. Choose a smaller number if you want some processing resources to remain available for other processes. Will issue a warning if too many cores are requested and reset to the maximum available.

cache

whether to cache iso_files. Note that R Data Storage files (.rds, see iso_save) are never cached since they are already essentially in cached form.

read_cache

whether to reload from cache if a cached version exists. Note that it will only read from cache if the raw data file has not been modified since. Files that have been modified on disc (e.g. edited in the vendor software) will always be read anew. To automatically reread cached files that were cached by an outdated version of the isoreader package, set the reread_outdated_cache flag.

reread_outdated_cache

whether to re-read outdated cache files whenever they are encountered.

quiet

whether to display (quiet=FALSE) or silence (quiet = TRUE) information messages. Set parameter to overwrite global defaults for this function or set global defaults with calls to iso_turn_info_messages_on and iso_turn_info_messages_off

Value

single iso_file object (if single file) or list of iso_files (iso_file_list)


isoreader documentation built on Nov. 19, 2021, 1:07 a.m.