add_total_absolute_abundance()
calculates the total absolute abundances
of the samples given a spike taxon, and adds this to the sample table under
the column name "total_absolute_abundance".
See also
Other sample-modifiers:
add_alpha()
,
add_alphas()
,
add_metadata()
,
add_ord()
,
add_sample_clustered()
,
add_spike_ratio()
,
add_total_count()
,
add_total_density()
,
cluster_samples()
Examples
# Initiate count matrix
x <- matrix(
c(1500, 1300, 14, 280, 356, 9),
ncol = 2
)
rownames(x) <- c("taxon1", "taxon2", "taxon3")
colnames(x) <- c("sample1", "sample2")
# Convert to tidytacos object
data <- create_tidytacos(x,
taxa_are_columns = FALSE
)
data$samples$spike_added <- c(100, 150)
# Add total abundance
data <- data %>%
add_total_absolute_abundance(spike_taxon = "t3")