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, ...)

Arguments

fun

the analysis function

data

the dataset

...

additional arguments to pass to fun

Value

a tibble with these columns:

resultsthe output of fun(data)
metadatathe metadata component of the original dataset
datasetthe name of the dataset
methodthe name of the analysis function
argsa list of optional args to method

Examples

if (FALSE) { sgs_data <- MATSS::get_sgs_data() invoke(ts_summary, sgs_data) }