View source: R/matsindf_apply.R
get_useable_default_args | R Documentation |
formals(FUN)
does not handle arguments without a default well,
returning a name
vector of length 1
,
which when converted to character is "".
This function detects that condition and replaces the no-default argument with
the value of .no_default
, by default NULL
.
get_useable_default_args(FUN, which = c("values", "names"), no_default = NULL)
FUN |
A function from which values of default arguments are to be extracted. |
which |
Tells whether to get "names" of arguments or "values" of arguments. Default is "values". |
no_default |
The placeholder value for arguments with no default. |
A named list of default arguments to FUN
.
Names are the argument names.
Values are the default argument values.
f <- function(a = 42, b) {
return(a + b)
}
matsindf:::get_useable_default_args(f)
matsindf:::get_useable_default_args(f, no_default = logical())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.