percent_table: Convert a counts table to fraction of total observations

Description Usage Arguments Examples

View source: R/utilities.R

Description

Use either rowSums or colSums to convert each cell to a fraction of total observations by row or columns

Usage

1
percent_table(df = df, by = "Row", transpose = TRUE)

Arguments

df

Either a data frame or a table produced by base::table()

by

Input vectors are either "Row" or "Column"

transpose

Transpose resulting table back to original orientation

Examples

1
2
3
4
## Not run: 
t = percent_table(df = df, by = "Row", transpose = TRUE)

## End(Not run)

BrianLohman/SingleCellGarage documentation built on Feb. 24, 2022, 4:58 a.m.