Skip to contents

Computes 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.

Usage

compute_descriptives(d0, vois)

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):

  1. variable name,

  2. variable label,

  3. variable type (one of "continuous", "binary", "nominal"),

  4. optional: variable group,

  5. optional: label-to-description mapping for table notes,

  6. optional: score type description to append in parentheses.

Alternatively, a path to a CSV file (semicolon-delimited) containing this information.

Value

A list containing:

table

A tibble with raw descriptive statistics.

gtable

An 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"))
} # }