Returns a myClim object in the same format as the input, with added states.
Arguments
data
myClim object see myClim-package
source_sensor
A logical sensor to be converted to states.
tag
A tag for the new states, e.g., "snow".
to_sensor
A vector of sensor names to which the new states should be attributed.
value
The value of the new states (default is NA)
inverse
A logical value. If FALSE, states are created for periods when source_sensor is TRUE (default is FALSE).
Details
The function is applicable only for logical (TRUE/FALSE) sensors. It allows
you to convert such sensors into a state, represented as a tag. For example,
you might calculate the estimation of snow cover using mc_calc_snow (TRUE/FALSE)
and then want to remove temperature records when the logger was covered by snow.
In this case, you can convert the snow sensor to a state, and then replace the
values with NA for that state using mc_states_replace. In opposite case
when you wish to keep e.g. only the moisture records when sensor was covered by
snow, use inverse = TRUE.