mc_states_outlier | R Documentation |
This function creates a state (tag) for all values that are either above
or below certain thresholds (min_value
, max_value
), or at break
points where consecutive values of microclimate time-series suddenly
jump down or up (positive_jump
, negative_jump
).
mc_states_outlier(
data,
table,
period = NULL,
range_tag = "range",
jump_tag = "jump"
)
data |
myClim object see myClim-package |
table |
The table with outlying values (thresholds). You can use the output of
|
period |
Period for standardizing the value of jump. If NULL, then the difference is not standardized (default NULL); see details. It is a character string usable by lubridate::period, for example, "1 hour", "30 minutes", "2 days". |
range_tag |
The tag for states indicating that the value is out of range (default "range"). |
jump_tag |
The tag for states indicating that the difference between two consecutive values is too high (default "jump"). |
The best way to use this function is to first generate a
table (data.frame) with pre-defined minimum, maximum, and jump thresholds
using the mc_info_range function. Then modify the thresholds as needed
and apply the function (see example). All values above max_value
and below
min_value
are tagged by default with the range
tag. When consecutive
values suddenly decrease by more than negative_jump
or increase
by more than positive_jump
, such break points are tagged with the jump
tag.
It is possible to use only the range
case, only the jump
case, or both.
When the period
parameter is used, the jump values are modified;
range values are not affected. Depending on the logger step, the
value of jump is multiplied or divided. For example, when the loggers
are recording with a step of 15 minutes (900 s) and the user sets
period = "1 hour"
together with positive_jump = 10
, then consecutive
values differing by (10 * (15 / 60) = 2.5) would be tagged. In this example,
but with recording step 2 hours (7200 s), consecutive values differing
by (10 * (120 / 60) = 20) would be tagged.
Returns a myClim object in the same format as the input, with added states.
range_table <- mc_info_range(mc_data_example_clean)
range_table$negative_jump[range_table$sensor_name == "TMS_moist"] <- 500
data <- mc_states_outlier(mc_data_example_clean, range_table)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.