report.freqTab {reporter} | R Documentation |
The function creates a frequency table (with percentages and cumulative percentages) with valid values and with missing values.
report.freqTab(x, dec = 2, cumulative = TRUE, useNA = "always")
x |
A vector with the values of categorical variable. |
dec |
Number of decimal places for percentages. |
cumulative |
Wheter to report cumulative frequencies and percentages or not. Default is TRUE. |
useNA |
Wheter to include NA values in the table. Default is always (it includes NAs even when the count of NAs is zero), other ppossible values are no (do not include NAs) and ifany (NAs are included if they are present in the data). See ?table for more. |
This is a modified function freqTab from the package multiUS. The aouthor of the original function is Aleš Žiberna.
Marjan Cugmas
x <- mtcars$gear x[sample(1:length(x), size = 5, replace = FALSE)] <- NA report.freqTab(x = x, dec = 2, useNA = "always")