powered by
Each category (or option) is a variable in the dataframe, and we count the number of sucess in each column. The column percent is the ratio between this count by the observation number.
sucess
percent
tab_freq_checkbox( data, columns, sucess = "checked", labels = NULL, variable_name = NULL )
return a dataframe with n and percent
n
dataframe object
character vector. Columns to count.
character scalar. Category indicating the sucess. Defaults to "checked".
character vector.Label of each category. Defaults to NULL.
character scalar. Name of field in the form. Defaults to NULL.
Missing values are ignored.
data <- data.frame( x1 = c("checked", "checked", "unchecked"), x2 = c("checked", "unchecked", "checked") ) tab_freq_checkbox(data, c("x1", "x2"))
Run the code above in your browser using DataLab