Learn R Programming

volker (version 2.1.0)

tab_metrics_items_grouped: Output the means for groups in one or multiple columns

Description

Output the means for groups in one or multiple columns

Usage

tab_metrics_items_grouped(
  data,
  cols,
  cross,
  digits = 1,
  values = c("m", "sd"),
  labels = TRUE,
  clean = TRUE,
  ...
)

Value

A volker tibble.

Arguments

data

A tibble.

cols

The item columns that hold the values to summarize.

cross

The column holding groups to compare.

digits

The number of digits to print.

values

The output metrics, mean (m), the standard deviation (sd) or both (the default).

labels

If TRUE (default) extracts labels from the attributes, see codebook.

clean

Prepare data by data_clean.

...

Placeholder to allow calling the method with unused parameters from tab_metrics.

Examples

Run this code
library(volker)
data <- volker::chatgpt

tab_metrics_items_grouped(data, starts_with("cg_adoption_"), sd_gender)

Run the code above in your browser using DataLab