Missing | R Documentation |
Missing
can be used to test whether a value is the missing argument.
Missing(x, name)
x |
an object of class |
name |
character string or symbol, the name of the argument to test for missing-ness. |
Missing
will return FALSE
when an argument has a value, even if
it was not provided. See Examples.
Missing
does not evaluate its argument name
, similar to
missing
.
TRUE
or FALSE
parser <- essentials::ArgumentParser()
parser$add.argument("--arg1")
parser$add.argument("--arg2", default = "def")
pargs <- parser$parse.args()
list(
arg1 = essentials::Missing(pargs, arg1),
arg2 = essentials::Missing(pargs, "arg2")
)
# with R >= 4.1.0, use the forward pipe operator `|>` to
# make calls to `Missing` more intuitive:
# list(
# arg1 = pargs |> essentials::Missing(arg1),
# arg2 = pargs |> essentials::Missing("arg2")
# )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.