Skip to contents

Output a frequency table for the values in one column

Usage

tab_counts_one(
  data,
  col,
  ci = FALSE,
  percent = TRUE,
  labels = TRUE,
  clean = TRUE,
  ...
)

Arguments

data

A tibble.

col

The column holding values to count.

ci

Whether to compute 95% confidence intervals using stats::prop.test.

percent

Proportions are formatted as percent by default. Set to FALSE to get bare proportions.

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

Value

A volker tibble.

Examples

library(volker)
data <- volker::chatgpt

tab_counts_one(data, sd_gender)
#> 
#> 
#> |Gender  |   n|    p|
#> |:-------|---:|----:|
#> |female  |  40|  40%|
#> |male    |  60|  59%|
#> |diverse |   1|   1%|
#> |total   | 101| 100%|