| filter_cv | R Documentation |
Filters Features based on their coefficient of variation (CV).
The CV is defined as CV = \frac{s_i}{\overline{x_i}} with s_i = Standard deviation of sample i and \overline{x_i} = Mean of sample i.
filter_cv(
data,
reference_samples,
max_cv = 0.2,
ref_as_group = FALSE,
group_column = NULL,
na_as_zero = TRUE
)
data |
A tidy tibble created by |
reference_samples |
The names of the samples or group which will be used to calculate the CV of a feature. Usually Quality Control samples. |
max_cv |
The maximum allowed CV. 0.2 is a reasonable start. |
ref_as_group |
A logical indicating if |
group_column |
Only relevant if |
na_as_zero |
Should |
A filtered tibble.
Coefficient of Variation on Wikipedia
# Example 1: Define reference samples by sample names
toy_metaboscape %>%
filter_cv(max_cv = 0.2, reference_samples = c("QC1", "QC2", "QC3"))
# Example 2: Define reference samples by group name
toy_metaboscape %>%
join_metadata(toy_metaboscape_metadata) %>%
filter_cv(max_cv = 0.2, reference_samples = "QC", ref_as_group = TRUE, group_column = Group)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.