This function is a helper that, at its core, simply applies the function to the dataset. The key added functionality is to preserve the names of the function and the dataset, as well as metadata and any additional arguments; returning the result in a tibble that is consistent in format, regardless of what function is actually being invoked.
invoke(fun, data, ...)
fun | the analysis function |
---|---|
data | the dataset |
... | additional arguments to pass to |
a tibble with these columns:
results | the output of fun(data) |
metadata | the metadata component of the original dataset |
dataset | the name of the dataset |
method | the name of the analysis function |
args | a list of optional args to method |