desc_value | R Documentation |
DESCRIPTION
file field, cleaned up and with dynamic fallbackReturns the value from a DESCRIPTION
file field (aka key). Whitespaces at the start and end of the value as well as repeated whitespaces within
it are removed.
desc_value(
key,
file = ".",
default = glue::glue("<No `{key}` field set in DESCRIPTION!>")
)
key |
The field to query. |
file |
DESCRIPTION file to use. By default the DESCRIPTION file of the current package (i.e. the package the working directory is part of) is used. |
default |
Default value to return if |
This function is a slightly modified version of desc::desc_get_field()
that allows the default
parameter to be dependent on the key
parameter.
By default, the following string is returned if key = "NoRealKey"
is not found:
"<No `NoRealKey` field set in DESCRIPTION!>"
If you rather want to take an action like throwing an error, it's recommended to call desc::desc_get_field()
directly.
A character scalar.
Other package DESCRIPTION
functions:
desc_dep_vrsn()
,
desc_list()
,
desc_url_git()
pal::desc_value(key = "Description",
file = fs::path_package("pal"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.