extract_yaml_dir {yum} | R Documentation |
These function extracts all YAML fragments from all files in a directory returning a list of character vectors containing the extracted fragments.
extract_yaml_dir( path, recursive = TRUE, fileRegexes = c("^[^\\.]+.*$"), delimiterRegEx = "^---$", ignoreOddDelimiters = FALSE, encoding = "UTF-8", silent = TRUE )
path |
The path containing the files. |
recursive |
Whether to also process subdirectories ( |
fileRegexes |
A vector of regular expressions to match the files
against: only files matching one or more regular expressions in this
vector are processed. The default regex ( |
delimiterRegEx |
The regular expression used to locate YAML fragments. |
ignoreOddDelimiters |
Whether to throw an error (FALSE) or delete the last delimiter (TRUE) if an odd number of delimiters is encountered. |
encoding |
The encoding to use when calling |
silent |
Whether to be silent ( |
A list of character vectors.
### First get the directory where 'yum' is installed yumDir <- system.file(package="yum"); ### Specify the path of some example files examplePath <- file.path(yumDir, "extdata"); ### Show files (should be three .dct files) list.files(examplePath); ### Load these files yum::extract_yaml_dir(path=examplePath);