Description Usage Arguments Value Examples
Frequency table of the number of times of individual value occurs
1 2 |
dt_data |
a data.table. |
v_s_vars |
a character vector of column names in dt_data. |
b_total_row |
default FALSE, whether we include a row with the total amount of values. |
b_include_perc |
default FALSE, whether we include a column with percentages. |
s_order_by |
default "v_s_vars". How the output data.table should be ordered. If "v_s_vars", ordered by values of parameter. If "ascending", ordered by ascending frequency. If "descending", ordered by "descending" frequency. |
A data.table with the number of times an individual value occurs
1 2 3 4 5 6 7 8 | library(data.table)
dt_data <- data.table( var1 = c(1,1,2,2,3,3,3,3),
var2 = c(6,6,6,7,7,7,7,7))
freqTable(dt_data, "var1", b_total_row = TRUE)
freqTable(dt_data, c("var1","var2"), b_include_perc = TRUE)
freqTable(dt_data, c("var1","var2"), b_include_perc = TRUE, s_order_by = "descending" )
freqTable(dt_data, c("var1","var2"), b_total_row = TRUE,
b_include_perc = TRUE, s_order_by = "descending")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.