row_percent_convert {dataMojo} | R Documentation |
Convert count to percentage
Description
Convert count to percentage
Usage
row_percent_convert(data, cols_rowsum)
Arguments
data |
data frame |
cols_rowsum |
columns need to be converted to percentage |
Value
data frame with calculated row percentage
Examples
test_df <- data.frame(
Group = c("A", "B", "C"),
Female = c(2,3,5),
Male = c(10,11, 13)
)
dataMojo::row_percent_convert(test_df, cols_rowsum = c("Female", "Male"))
[Package dataMojo version 1.0.0 Index]