How to create reports?"

# Markdown options
knitr::opts_chunk$set(echo = FALSE, warning = TRUE)

# Load packages
library(dplyr)
library(volker)
library(ggplot2)

theme_set(theme_bw())

data <- volker::chatgpt

A single categorical variable

report_counts(data, sd_gender, ci=TRUE)

A cross table

data %>% 
  filter(sd_gender != "diverse") %>% 
  report_counts(adopter, sd_gender, prop="rows", ci=TRUE, effect=TRUE)

Automatic index calculation

data %>% 
  filter(sd_gender != "diverse") %>% 
  report_counts(starts_with("cg_adoption_"), index=TRUE, ci=TRUE, effect=TRUE)

Automatic factor calculation

data %>%  
  report_metrics(starts_with("cg_adoption_"), factors = TRUE)

Automatic cluster calculation

data %>%  
  report_metrics(starts_with("cg_adoption_"), clusters = TRUE)

Group comparisons of an index

data %>% 
  dplyr::filter(sd_gender != "diverse") %>% 
  report_metrics(starts_with("cg_adoption_"), sd_gender, index=TRUE, ci=TRUE, effect=TRUE)

Print lists

rp <- report_metrics(data, sd_age, sd_gender, effect = TRUE)
print(rp)

Mixed content

Adoption types

data %>% 
  filter(sd_gender != "diverse") %>% 
  report_counts(adopter, sd_gender, prop="rows", title= FALSE, close= FALSE)
Method

Basis: Only male and female respondents.

{-}



Try the volker package in your browser

Any scripts or data that you put into this service are public.

volker documentation built on April 12, 2025, 9:16 a.m.