Description Usage Arguments Details Value See Also Examples
View source: R/step_distributed_lag.R
'step_distributed_lag' creates a *specification* of a recipe step that are distributed lag versions of a particular variable. Uses FFT for fast calculation with a large maximum lag and many observations
1 2 3 4 5 |
recipe |
A recipe object. The step will be added to the sequence of operations for this recipe. |
... |
One or more selector functions to choose which variables are affected by the step. See [selections()] for more details. For the 'tidy' method, these are not currently used. |
role |
Defaults to "distributed_lag" |
trained |
A logical to indicate if the quantities for preprocessing have been estimated. |
knots |
specific knots for the lagging process |
spline_fun |
spline function to use i.e. splines::ns, splines::bs |
n_subset |
for distributed_lag parallel |
n_shift |
for distributed_lag parallel |
prefix |
A prefix for generated column names, default to "distributed_lag_". |
default |
Passed to |
columns |
A character string of variable names that will
be populated (eventually) by the |
skip |
A logical. Should the step be skipped when the
recipe is baked by |
id |
A character string that is unique to this step to identify it. |
'step_distributed_lag' calculates the earthtide response and then lags (leads) the terms.
An updated version of 'recipe' with the new step added to the sequence of existing steps (if any). For the 'tidy' method, a tibble with columns 'terms' which is the columns that will be affected and 'holiday'.
[step_lag_matrix()] [recipe()] [prep.recipe()] [bake.recipe()]
1 2 3 4 5 6 7 8 9 10 | data(transducer)
rec <- recipe(wl ~ .,
data = transducer[1:1000, list(datetime, wl, baro)])
with_et <- rec %>%
step_distributed_lag(baro, knots = c(0, 10, 100)) %>%
step_naomit(everything()) %>%
prep() %>%
juice()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.