View source: R/Quality_checking.R
exclude | R Documentation |
Interactive plots are used for identification and flagging of data for exclusion based on the visual inspection.
exclude(x, qc_x = NULL, y = NULL, z = NULL, name_out = "-", win_size = 672)
x |
A numeric vector with values to inspect. |
qc_x |
An integer vector in the range |
y , z |
A numeric vector with values of auxiliary variable helping with
the interpretation of |
name_out |
A character string providing |
win_size |
An integer. Number of |
Six options are available during the interactive session.
flag values: select interval of values to exclude or use double-click to flag single value.
undo last: allows to change the user flagging input back to the state before last flagging.
refresh plots: apply current user flagging input to the plots. It removes excluded points and affects y-axis range or it can show again excluded points if option 2 (undo last) was applied before.
next plot.
jump to plot: any plot within the existing range (see as a plot title) can be selected.
finalize: finish the flagging and return the results.
The interactive session will be finished successfully also when option 4 (next plot) is executed while at the last plot.
An integer vector with attributes "varnames"
and
"units"
.
check_manually
## Not run:
# prepare mock data
set.seed(87)
my_var <- sin(seq(pi / 2, 2.5 * pi, length = 48)) * 10
my_var[my_var > 5] <- 5
PAR <- (-my_var + 5) * 100
Tair <- rep(-cos(seq(0, 2 * pi, length = 48)), 14)
Tair <- Tair * 2 + 15 + seq(0, 5, length = 48 * 14)
# combine into data frame
a <- data.frame(
my_var = my_var + rnorm(48 * 14),
my_qc = sample(c(0:2, NA), 672, replace = TRUE, prob = c(5, 3, 2, 1)),
PAR = PAR,
Tair = Tair
)
# include spikes
a$my_var[c(152, 479)] <- c(231, -2000)
# flag data manually
exclude(x = a$my_var, qc_x = a$my_qc)
exclude(x = a$my_var, qc_x = a$my_qc, y = a$PAR)
exclude(x = a$my_var, qc_x = a$my_qc, y = a$PAR, z = a$Tair)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.