Read and parse the extraction scripts in a directory

rxs_parseExtractionScripts(
  path,
  pattern = "\\.[Rr]xs\\.[Rr]md$|\\.Rxs$",
  exclude = c("extractionScriptTemplate.[Rr]xs.[Rr]md", "\\[EXCLUDED]"),
  ignore.case = TRUE,
  recursive = TRUE,
  silent = metabefor::opts$get("silent"),
  progressBar = TRUE,
  showErrors = TRUE,
  encoding = "UTF-8",
  parallel = FALSE
)

Arguments

path

The path containing the extraction scripts.

pattern

The regular expression specifying which files to read.

exclude

A regular expression specifying which files to ignore.

ignore.case

Whether the regular expression is case sensitive.

recursive

Whether to also look in subdirectories.

silent

Whether to be quiet or chatty.

progressBar

Whether to show the progress bar.

showErrors

Whether to show or hide errors that are encountered.

encoding

The files' encoding.

parallel

Whether to use parallel processing.

Value

A list of parsed extraction scripts.

Examples

### Path with example Rxs files
rxsProject_path <-
  system.file(
    "extdata",
    "extraction-examples",
    package = "metabefor"
  ); 

### Parse the files
example_rxsProject <-
  metabefor::rxs_parseExtractionScripts(
    rxsProject_path
  );

### Show the imported project
example_rxsProject;
#> 
#> This Rxs project contains 2 Rxs trees (suggesting it contains data extracted from 2 sources).
#> 
#> These trees contain the following entities:
#> 
#> 'general', 'publicationYear', 'sourceAuthors', 'sourceTitle', 'modeInfo', 'methods', 'sample', 'sampleSize', 'samplingStrategy', 'method', 'variables', 'chalk', 'witches', 'crayons', 'instruments', 'associations', 'chalk_and_witches', 'criminals', 'cops', 'criminals_and_cops', 'NA', 'variableIdentifier', 'measurementLevel', 'associationIdentifier', 'varId1', 'varId2', 'r' & 't'.