invoke: Invoke an analysis on a dataset

Description Usage Arguments Value Examples

View source: R/analysis_wrapper.R

Description

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.

Usage

1
invoke(fun, data, ...)

Arguments

fun

the analysis function

data

the dataset

...

additional arguments to pass to fun

Value

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

Examples

1
2
3
4
5
## Not run: 
  sgs_data <- MATSS::get_sgs_data()
  invoke(ts_summary, sgs_data)

## End(Not run)

weecology/MATSS documentation built on May 15, 2020, 7:03 p.m.