Description Usage Arguments Value Examples
Checking the plausible range of a sequence of observations;
The observations should be no less than the lower.bound
and no more than the upper.bound
;
Generating a new sequence of flags, and outputting a new sequence of observations after removing failed observations.
1 2 3 4 5 6 7 8 | range_check(
data,
data.column,
datetime.column,
upper.bound,
lower.bound = 0,
monthly.bounds = TRUE
)
|
data |
a data.frame that includes observation data with information. |
data.column |
a character, the selected column name in the data.frame that represents observation data to be checked. |
datetime.column |
a character, the selected column name in the data.frame that represents the reporting dates and times of corresponding observations. |
upper.bound |
a real number that controls the maximum allowed value of observations. |
lower.bound |
a real number that controls the minimum required value of observations (default value = 0). |
monthly.bounds |
a logical, if |
a new tbl_df that extends two new columns on the input data,
the first added column flag_range
represents the flags (P
means pass, fail.range
means fail,
missing
means missing values of observations), the second added column new_data_range
represents
the observation data after removing failed observations.
1 2 3 4 5 6 7 8 | library(tidyverse)
datetime = as.POSIXct(seq(0,60000,600), origin = "2017-02-03 08:00:00")
test_data = tibble(datetime = datetime,
windspeed = c(0:20,20:1,1:20,20:1,1:20))
test_range_check = range_check(test_data, data.column = 'windspeed',
datetime.column = 'datetime', upper.bound = c(11:22))
attributes(test_range_check)
test_range_check
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.