| manifest_cli | R Documentation |
Generate a manifest CSV from a directory of files from the command line. This function is meant to be run with Rscript, not to be called interactively. It reads the command line arguments, parses them, and calls write_manifest_from_dir. It is the engine behind the standalone make_manifest.R script that ships with the package (see manifest_script).
manifest_cli(args = commandArgs(trailingOnly = TRUE))
args |
character vector. The command line arguments. Defaults to the arguments actually passed to the R script ( |
Supported arguments (each flag can be given as --flag value or as --flag=value):
--dir <path>: The directory containing the data files (required).
--out <path>: The path of the CSV file to write the manifest to (required).
--url-base <url>: Optional base URL used to derive the download URL of every file, as paste0(url_base, path).
--help: Print usage information and exit without generating anything.
A leading --args or -- marker (used by Rscript to separate command line arguments from R options) is ignored, so both the one-liner form and the script form shown in the examples work.
The generated manifest as a data.frame, invisibly, or NULL if --help was given.
## Not run:
# One-liner from the shell (no script file needed):
Rscript -e 'pkgfilecache::manifest_cli()' --args --dir ~/mydata --out files.csv
# Same thing using the standalone script shipped with the package
# (--url-base is optional and derives the download URLs):
Rscript "$(Rscript -e 'cat(pkgfilecache::manifest_script())')" --dir ~/mydata --out files.csv
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.