check_named_list | R Documentation |
This function checks that the top level of a list is named (ignoring empty lists if requested). If the list is not named, the function returns a helpful error message. Otherwise, the list is returned unchanged. This is particularly useful within functions that use do.call
to evaluate lists of arguments.
check_named_list(arg = deparse(substitute(input)), input, ignore_empty = TRUE)
arg |
(optional) A character string which defines the argument of a parent function. |
input |
A list. |
ignore_empty |
A logical input which defines whether or not to ignore empty lists. |
The function returns a helpful error message for unnamed lists (ignoring empty lists if requested) or the inputted list unchanged.
Edward Lavender
This function is taken from the ‘utils.add’ package (https://github.com/edwardlavender/utils.add). It is defined separately in flapper
to reduce reliance on non-default packages.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.