parseArgs | R Documentation |
Parse command line argument flags
parseArgs(
required = character(),
optional = character(),
flags = character(),
positional = FALSE
)
positionalArgs()
hasPositionalArgs()
required, optional |
|
flags |
|
positional |
|
list
.
Named list containing arguments, organized by type:
required
optional
flags
positional
Updated 2023-10-27.
argparse Python package.
argparser R package.
optparse R package.
## Inside Rscript:
## > args <- parseArgs(
## > required = c("aaa", "bbb"),
## > optional = c("ccc", "ddd"),
## > flags = "force",
## > positional = TRUE
## > )
## > aaa <- args[["required"]][["aaa"]]
## > force <- "force" %in% args[["flags"]]
## > posArgs <- args[["positional"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.