View source: R/Quality_checking.R
apply_QC | R Documentation |
Apply quality control information to the respective numeric vector.
apply_QC(x, qc, qc_thr = 2, na.as = NA)
x |
A numeric vector. |
qc |
A numeric vector. |
qc_thr |
An integer value. |
na.as |
An integer value or |
Values of x
are set to NA
if qc
value (flag) equals or
is above qc_thr
or if qc
value is missing.
na.as = 0
can be used to preserve x
values with respective
NA
qc
values.
A numeric vector of length x
with attributes "varnames"
and "units"
.
set.seed(215)
qc <- sample(0:2, 10, replace = TRUE)
apply_QC(1:10, qc)
# set stricter qc_thr
apply_QC(1:10, qc, qc_thr = 1)
# NAs in qc
is.na(qc) <- c(4, 6)
apply_QC(1:10, qc)
# preserve x values for NA qc
apply_QC(1:10, qc, na.as = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.