View source: R/aso_freq_function_repeated.R
freq_function_repeated | R Documentation |
freq_function()
to get frequencies for many variables in one
go.A method for making multiple 1- and 2-way frequency tables with percentages and odds ratios.
freq_function_repeated(
normaldata,
var1,
var2 = NULL,
by_vars = NULL,
include_NA = FALSE,
values_to_remove = NULL,
weightvar = NULL,
textvar = NULL,
number_decimals = 2,
output = c("all", "numeric", "col", "colw", "row", "roww", "total", "totalw"),
chisquare = FALSE
)
normaldata |
A data frame or data frame extension (e.g. a tibble). |
var1 |
A character vector with the names of the first variable to get frequencies from for each frequency table. |
var2 |
An optional character naming the second variable to get
frequencies. If |
by_vars |
An optional character vector naming variables in |
include_NA |
A logical. If |
values_to_remove |
An optional character vector. When specified all
values from |
weightvar |
An optional character naming a column in |
textvar |
An optional character. When specified |
number_decimals |
A numeric indicating the number of decimals to show on percentages and weighted frequencies in the combined frequency and percent variables. |
output |
A character indicating the output type wanted:
|
chisquare |
A logical. |
Multiple frequency tables stored in a data frame object.
ASO
freq_function()
for the function that creates frequency tables for
single variables.
# Examples
data("starwars", package = "dplyr")
test_table1 <- freq_function_repeated(
starwars,
var1 = c("sex","homeworld","eye_color"),
include_NA = TRUE
)
test_table2 <- freq_function_repeated(
starwars,
var1 = c("homeworld","eye_color","skin_color"),
var2 = "sex",
output = "col",
number_decimals = 3
)
test_table3 <- freq_function_repeated(
starwars,
var1 = c("homeworld","eye_color","skin_color"),
var2 = "sex",
by_vars = c("gender"),
output = "row"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.