state_setval {onlineforecast} | R Documentation |
Set a state value to be kept for next the transformation function is called.
Description
Set a state value to be kept for next the transformation function is called.
Usage
state_setval(val)
Arguments
val |
The value to set and kept for next call. |
Details
Transformation functions (e.g. lp
, fs
, bspline
) can need to keep a state value between calls, e.g. when new data arrives and must be transformed. This function is used to setting the state values set in last call to the function.
Uses the input_class$state_getval()
.
See Also
state_setval()
for setting the state value and input_class
.
Examples
# See how it can be used in lp, which needs to save the state of the filter
# Note how it is not needed to do anything else than getting and setting the state
# in transformations (model$transform_data()), then multiple transformation functions can be called,
# but they are always in the same order, so the state (set,get) functions keep a counter internally
# to make sure that the correct values are set and returned when called again.
lp
[Package onlineforecast version 1.0.2 Index]