Learn R Programming

{ggstatsplot}: {ggplot2} Based Plots with Statistical Details

StatusUsageMiscellaneous

Raison d’être

“What is to be sought in designs for the display of information is the clear portrayal of complexity. Not the complication of the simple; rather … the revelation of the complex.” - Edward R. Tufte

{ggstatsplot} is an extension of {ggplot2} package for creating graphics with details from statistical tests included in the information-rich plots themselves. In a typical exploratory data analysis workflow, data visualization and statistical modeling are two different phases: visualization informs modeling, and modeling in its turn can suggest a different visualization method, and so on and so forth. The central idea of {ggstatsplot} is simple: combine these two phases into one in the form of graphics with statistical details, which makes data exploration simpler and faster.

Installation

TypeCommand
Releaseinstall.packages("ggstatsplot")
Developmentpak::pak("IndrajeetPatil/ggstatsplot")

Citation

If you want to cite this package in a scientific journal or in any other context, run the following code in your R console:

citation("ggstatsplot")
To cite package 'ggstatsplot' in publications use:

  Patil, I. (2021). Visualizations with statistical details: The
  'ggstatsplot' approach. Journal of Open Source Software, 6(61), 3167,
  doi:10.21105/joss.03167

A BibTeX entry for LaTeX users is

  @Article{,
    doi = {10.21105/joss.03167},
    url = {https://doi.org/10.21105/joss.03167},
    year = {2021},
    publisher = {{The Open Journal}},
    volume = {6},
    number = {61},
    pages = {3167},
    author = {Indrajeet Patil},
    title = {{Visualizations with statistical details: The {'ggstatsplot'} approach}},
    journal = {{Journal of Open Source Software}},
  }

Acknowledgments

I would like to thank all the contributors to {ggstatsplot} who pointed out bugs or requested features I hadn’t considered. I would especially like to thank other package developers (especially Daniel Lüdecke, Dominique Makowski, Mattan S. Ben-Shachar, Brenton Wiernik, Patrick Mair, Salvatore Mangiafico, etc.) who have patiently and diligently answered my relentless questions and supported feature requests in their projects. I also want to thank Chuck Powell for his initial contributions to the package.

The hexsticker was generously designed by Sarah Otterstetter (Max Planck Institute for Human Development, Berlin). This package has also benefited from the larger #rstats community on Twitter, LinkedIn, and StackOverflow.

Thanks are also due to my postdoc advisers (Mina Cikara and Fiery Cushman at Harvard University; Iyad Rahwan at Max Planck Institute for Human Development) who patiently supported me spending hundreds (?) of hours working on this package rather than what I was paid to do.

Copy Link

Version

Install

install.packages('ggstatsplot')

Monthly Downloads

12,062

Version

0.13.0

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Indrajeet Patil

Last Published

December 4th, 2024

Functions in ggstatsplot (0.13.0)

ggwithinstats

Box/Violin plots for repeated measures comparisons
ggscatterstats

Scatterplot with marginal distributions and statistical results
grouped_ggbetweenstats

Violin plots for group or condition comparisons in between-subjects designs repeated across all levels of a grouping variable.
ggpiestats

Pie charts with statistical tests
ggdotplotstats

Dot plot/chart for labeled numeric data.
grouped_ggcorrmat

Visualization of a correlalogram (or correlation matrix) for all levels of a grouping variable
grouped_ggdotplotstats

Grouped histograms for distribution of a labeled numeric variable
gghistostats

Histogram for distribution of a numeric variable
ggstatsplot-package

ggstatsplot: 'ggplot2' Based Plots with Statistical Details
grouped_ggbarstats

Grouped bar charts with statistical tests
movies_long

Movie information and user ratings from IMDB.com (long format).
theme_ggstatsplot

Default theme used in {ggstatsplot}
grouped_gghistostats

Grouped histograms for distribution of a numeric variable
grouped_ggscatterstats

Scatterplot with marginal distributions for all levels of a grouping variable
grouped_ggpiestats

Grouped pie charts with statistical tests
reexports

Objects exported from other packages
grouped_ggwithinstats

Violin plots for group or condition comparisons in within-subjects designs repeated across all levels of a grouping variable.
iris_long

Edgar Anderson's Iris Data in long format.
combine_plots

Combining and arranging multiple plots in a grid
.grouped_list

Split data frame into a list by grouping variable
ggbarstats

Stacked bar charts with statistical tests
ggcorrmat

Visualization of a correlation matrix
extract_stats

Extracting data frames or expressions from {ggstatsplot} plots
ggbetweenstats

Box/Violin plots for between-subjects comparisons
ggcoefstats

Dot-and-whisker plots for regression analyses
.is_palette_sufficient

Check if palette has enough number of colors
Titanic_full

Titanic dataset.
bugs_long

Tidy version of the "Bugs" dataset.