View source: R/Data_handling.R
summary_QC | R Documentation |
summary_QC
is a function that summarizes quality checking results in a
form of table or plot.
summary_QC(
x,
qc_names,
cumul = FALSE,
plot = FALSE,
perc = TRUE,
flux = NULL,
na.as = NULL,
na.as_0_pattern = "spikesLF$|fetch70$|man$",
additive = NULL,
additive_pattern = "interdep$|wresid$",
no_messages = FALSE
)
x |
A data frame with column names. |
qc_names |
A vector of names of data frame |
cumul |
A logical value that determines if cumulative ( |
plot |
A logical value. If |
perc |
A logical value. If |
flux |
A character string. Used only if |
na.as |
|
na.as_0_pattern |
A character string. A |
additive |
|
additive_pattern |
A character string. A |
no_messages |
A logical value. |
summary_QC
loads a data frame x
, extracts quality control (QC)
columns from it based on qc_names
and creates a table (plot =
FALSE
) or a plot (plot = TRUE
) for these columns. Results are
displayed as percentages (perc = TRUE
) or counts (perc = FALSE
)
for given flag and QC filter.
cumul = TRUE
specifies that cumulative effect of gradually applied QC
filters on resulting flags is considered. Note that for cumul = TRUE
the results do depend on the order of qc_names. additive
is considered
only if cumul = TRUE
, otherwise skipped.
For a detailed description of automated recognition see
combn_QC
.
A table or a ggplot object depending on the plot
argument
value. If length(qc_names) == 0
, NULL
is returned instead.
combn_QC
, ggplot
.
set.seed(6)
aa <- as.data.frame(replicate(
6, sample(c(0:2, NA), 20, replace = TRUE, prob = c(0.6, 0.25, 0.1, 0.05))))
names(aa) <- letters[1:6]
summary_QC(aa, letters[1:6])
summary_QC(aa, letters[1:6], na.as = c(NA, 0, NA, NA, NA, NA))
summary_QC(aa, letters[1:6], cumul = TRUE, additive = TRUE)
summary_QC(aa, letters[1:6], cumul = TRUE, additive = FALSE)
is_add <- c(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE)
summary_QC(aa, letters[1:6], cumul = TRUE, additive = is_add)
library(ggplot2)
(xx <- summary_QC(aa, letters[1:6], cumul = TRUE, plot = TRUE,
flux = "CO2 flux"))
xx + theme(text = element_text(size = 20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.