This internal function implements the factory method pattern for the sits package Its role is to create a generic interface to closures in R so that the functions in the sits package can be called in two different ways: 1. They can be called directly, passing input data and parameters. 2. They can be called as second-order values (parameters of another function). In the second case, the call will pass no data values and only pass the parameters for execution
The factory pattern is used in many situations in the sits package, to allow different alternatives for filtering, pattern creation, training, and cross-validation
.sits_factory_function(data.tb, fun)
Tibble with time series data and metadata.
The function that performs some calculation on the input data.