add_total_count() adds the total read count per sample to the sample
table of a tidytacos object under the variable name total_count.
Arguments
- ta
A tidytacos object.
Value
A tidytacos object with the total read count per sample added.
A tidytacos object with the total read count per sample added.
See also
Other sample-modifiers:
add_alpha(),
add_alphas(),
add_dominant_taxa(),
add_metadata(),
add_ord(),
add_sample_clustered(),
add_spike_ratio(),
add_subsampled_alpha(),
add_total_absolute_abundance(),
add_total_density(),
cluster_samples()
Examples
# Initiate counts matrix
x <- matrix(
c(1500, 1300, 280, 356),
ncol = 2
)
rownames(x) <- c("taxon1", "taxon2")
colnames(x) <- c("sample1", "sample2")
# Convert to tidytacos object
data <- create_tidytacos(x,
taxa_are_columns = FALSE
)
# Add total counts
data <- data %>%
add_total_count()