Learn R Programming

ggstatsplot (version 0.9.4)

extract_stats: Extracting data frames from {ggstatsplot} plots

Description

Extracting data frames from {ggstatsplot} plots

Usage

extract_stats(p, ...)

Value

A list of tibbles containing summaries of various statistical analyses. The exact details included will depend on the function.

Arguments

p

A plot from {ggstatsplot} package

...

Ignored

Details

This is a convenience function to extract data frames with statistical details that are used to create expressions displayed in {ggstatsplot} plots as subtitle, caption, etc. Note that all of this analysis is carried out by the {statsExpressions} package.

The only exception is the ggcorrmat() function. But, if a data frame is what you want, you shouldn't be using ggcorrmat() anyway. You can use correlation::correlation() function which provides tidy data frames by default.

Examples

Run this code
# \donttest{
if (require("PMCMRplus")) {
  set.seed(123)
  library(ggstatsplot)

  # in case of group comparisons
  p <- ggbetweenstats(mtcars, cyl, mpg)
  extract_stats(p)

  # the exact details depend on the function
  extract_stats(ggbarstats(mtcars, cyl, am))
}
# }

Run the code above in your browser using DataLab