Skip to contents

add_total_count() adds the total read count per sample to the sample table of a tidytacos object under the variable name total_count.

Usage

add_total_count(ta)

Arguments

ta

A tidytacos object.

Value

A tidytacos object with the total read count per sample added.

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()