state_setval | R Documentation |
Set a state value to be kept for next the transformation function is called.
state_setval(val)
val |
The value to set and kept for next call. |
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()
.
state_setval()
for setting the state value and input_class
.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.