convert_to_percentage: convert_to_percentage

Description Usage Arguments Examples

View source: R/convert_to_percentage.R

Description

convert_to_percentage can convert a data frame to percentage.

Usage

1
convert_to_percentage(df, row_sum = TRUE, hundred_percent = FALSE)

Arguments

df

A data frame.

row_sum

Default is TRUE. If row_sum == TRUE, then will take every value of a row and divide by the summary of this row, and apply this to every row. If row_sum == FALSE, then will take every value of a column and divide by the summary of this column, and apply this to every column. Total sum of the result is 1.

hundred_percent

Default is FALSE, if TRUE, turn value to 100 percent, total sum is 100.

Examples

1
convert_to_percentage(demo_dada2_result$seq_tab, row_sum = TRUE) %>% .[,1:5]

yeguanhuav/visual16S documentation built on Feb. 19, 2022, 10:32 a.m.