Describe the Sample
compute_descriptives.RdComputes descriptive summaries for a specified set of variables in a dataset. The output includes a raw summary tibble and an APA-style formatted gt table.
Arguments
- d0
A tibble containing the data, as generated by
prepare_data.- vois
A data frame, tibble, or matrix with the following columns (in this order):
variable name,
variable label,
variable type (one of "continuous", "binary", "nominal"),
optional: variable group,
optional: label-to-description mapping for table notes,
optional: score type description to append in parentheses.
Alternatively, a path to a CSV file (semicolon-delimited) containing this information.
Value
A list containing:
tableA tibble with raw descriptive statistics.
gtableAn APA-style formatted gt table summarizing selected variables.
See also
prepare_data() prepares d0.
Examples
if (FALSE) { # \dontrun{
p <- data_paths("data-raw")
data <- prepare_data(p)
demo <- compute_descriptives(data, here::here("data-raw", "VariablesOfInterest.csv"))
} # }