relabund: Relative Abundance from Counts

Description Usage Arguments Value Examples

View source: R/relabund.R

Description

This function converts values in a dataframe to a fraction/percentage of the sum of their column.

Usage

1
relabund(counttable, percentage = FALSE)

Arguments

counttable

Data frame of numeric values with rows as observations and columns as samples.

percentage

Should values be returned as a percentage? i.e multiplied by 100. Default is FALSE (as required for most IgA scoring approaches).

Value

A data frame of the input data normalised by column (to sum to either 1 or 100).

Examples

1
2
3
taxcounts <- data.frame(Sample1=c(1,2,10,10),Sample2=c(3,10,5,1))
rownames(taxcounts) <- c("Taxon1","Taxon2","Taxon3","Taxon4")
relabund(taxcounts)

IgAScores documentation built on Sept. 1, 2020, 9:08 a.m.