Description Usage Arguments Value
Calculates row percentages for a set of columns in a dataframe and returns
those percentages along with any preceding columns containing row labels or
other data. Use add_row_percent
to append the row percentages to the
input dataframe.
1 | get_row_percent(data, from = 2, to = ncol(data), na.rm = FALSE)
|
data |
A dataframe containing columns of numerical data to be expressed as row percentages. |
from |
The number or name of the column from which row percentages are calculated. The default is 2, assuming one column for row labels. Use 1 if there are no preceding data columns. |
to |
The number or name of the column to which row percentages are calculated. The default is ncol(data), which means row percentages are calculated across all remaining columms in the dataframe. |
na.rm |
A boolean which if TRUE ignores NAs in calculating percentages. The default value is FALSE. |
A tibble containing row percentages and any preceding columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.