row_percent_convert | R Documentation |
Convert count to percentage
row_percent_convert(data, cols_rowsum)
data |
data frame |
cols_rowsum |
columns need to be converted to percentage |
data frame with calculated row percentage
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.