Description Usage Arguments Details Examples
freq_by
creates frequency and percentage tables in HTML.
1 2 3 4 5 6 | freq_by(dataset, var_vector, by_group = NULL, include_total = TRUE,
min_cell_count = 10, htmlout = TRUE,
font_css = "font-family: monospace;", include_p_value = FALSE,
decimal_percent = 0, include_n = TRUE, include_percent = TRUE,
include_cumpct = FALSE, include_cumsum = FALSE,
include_subtotal = FALSE, include_n_missing = FALSE)
|
dataset |
A dataset |
var_vector |
A character vector containing names of the columns in the
|
by_group |
A string referring to a factor column in the |
include_total |
whether to include two extra columns of marginal
frequencies and percentages, i.e. not stratified by the |
min_cell_count |
a number which defaults to 10. Used to preserve anonymity in case of sensitive data. In cells with <= 10 observations, the string "<=10" is printed. |
htmlout |
Whether to output to html (default and intended usage), or as r-dataframe. |
font_css |
A string of CSS code defining the font used for the table. Default is'font-family: monospace;'. |
include_p_value |
logical. Wheather to do |
decimal_percent |
numeric. NUmber of decimals on the calculated percentages. |
include_n |
logical. Whether to include counts for each group. |
include_percent |
logical. Whether to include percentages. |
include_cumpct |
logical. Whether to include cumulative percentages. |
include_cumsum |
logical. Whether to include cumulative frequencies. |
include_subtotal |
logical. Whether to include subtotals. |
include_n_missing |
logical. Whether to include number of missing in each group. |
The output is a table in HTML which can be viewed in a browser or included in a knitr-report.
1 2 3 | # Outputs HTML:
output <-
epitable::freq_by(example_data, c("cut", "color"), "clarity", htmlout = FALSE, min_cell_count = 30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.