geomean {GeneScoreR} | R Documentation |
This function computes the geometric mean for each sample in the given count table.
geomean(count_table)
count_table |
A data frame of gene count data (genes as rows, samples as columns). All columns must be numeric. |
A data frame with the geometric means per sample and the sample IDs.
# Example data to be scored
count_table <- data.frame(
sample1 = c(1, 10, 100),
sample2 = c(2, 20, 200),
sample3 = c(3, 30, 300)
)
rownames(count_table) <- c("gene1", "gene2", "gene3")
# Calculate Geometric Mean per sample in the count_table
geomean(count_table)