Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extract_expressions() #727

Closed
IndrajeetPatil opened this issue Apr 1, 2022 · 1 comment
Closed

Add extract_expressions() #727

IndrajeetPatil opened this issue Apr 1, 2022 · 1 comment
Labels
breaking 💀 breaking changes enhancement 🔥 New feature or request

Comments

@IndrajeetPatil
Copy link
Owner

IndrajeetPatil commented Apr 1, 2022

Similar to how extract_stats() lets you extract data frames, this function will help you extract all expressions present in the plot.

This will also help get rid of the output argument.

How to make this work with grouped_ plots?

@IndrajeetPatil IndrajeetPatil added enhancement 🔥 New feature or request breaking 💀 breaking changes labels Apr 1, 2022
@IndrajeetPatil
Copy link
Owner Author

Already implemented:

library(ggstatsplot)

p <- ggscatterstats(mtcars, wt, mpg)
#> Registered S3 method overwritten by 'ggside':
#>   method from   
#>   +.gg   ggplot2

extract_caption(p)
#> list(log[e] * (BF["01"]) == "-17.84", widehat(rho)["Pearson"]^"posterior" == 
#>     "-0.84", CI["95%"]^HDI ~ "[" * "-0.92", "-0.73" * "]", italic("r")["beta"]^"JZS" == 
#>     "1.41")

extract_subtitle(p)
#> list(italic("t")["Student"] * "(" * 30 * ")" == "-9.56", italic(p) == 
#>     "1.29e-10", widehat(italic("r"))["Pearson"] == "-0.87", CI["95%"] ~ 
#>     "[" * "-0.93", "-0.74" * "]", italic("n")["pairs"] == "32")

Created on 2023-01-03 with reprex v2.0.2

As for what to do with the grouped plots, this is the same issue as #815.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking 💀 breaking changes enhancement 🔥 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant