knitr::opts_chunk$set(comment = "#>", collapse = TRUE)
library(jjstatsplot)
data(mtcars)

This vignette demonstrates the functions designed for categorical data: jjbarstats(), jjpiestats() and jjdotplotstats().

Bar charts with jjbarstats()

jjbarstats() creates a bar chart and automatically performs a chi-squared test to compare the distribution of two categorical variables. The example below compares the number of cylinders (cyl) across transmission types (am).

jjbarstats(data = mtcars, dep = cyl, group = am, grvar = NULL)

Pie charts with jjpiestats()

jjpiestats() is similar to jjbarstats() but displays the results as a pie chart.

jjpiestats(data = mtcars, dep = cyl, group = am, grvar = NULL)

Dot charts with jjdotplotstats()

jjdotplotstats() shows group means using a dot plot. In this example we plot horsepower (hp) by engine configuration (vs).

jjdotplotstats(data = mtcars, dep = hp, group = vs, grvar = NULL)

Each function returns a results object whose plot element contains the ggplot2 visualisation.



sbalci/ClinicoPathJamoviModule documentation built on June 13, 2025, 9:34 a.m.