grouped_ggbetweenstats | R Documentation |
Helper function for ggstatsplot::ggbetweenstats
to apply this function
across multiple levels of a given factor and combining the resulting plots
using ggstatsplot::combine_plots
.
grouped_ggbetweenstats( data, ..., grouping.var, output = "plot", plotgrid.args = list(), annotation.args = list() )
data |
A data frame (or a tibble) from which variables specified are to
be taken. Other data types (e.g., matrix,table, array, etc.) will not
be accepted. Additionally, grouped data frames from |
... |
Arguments passed on to
|
grouping.var |
A single grouping variable. |
output |
Character that describes what is to be returned: can be
|
plotgrid.args |
A |
annotation.args |
A |
ggbetweenstats
, ggwithinstats
,
grouped_ggwithinstats
if (require("PMCMRplus")) { # to get reproducible results from bootstrapping set.seed(123) library(ggstatsplot) library(dplyr, warn.conflicts = FALSE) library(ggplot2) # the most basic function call grouped_ggbetweenstats( data = filter(ggplot2::mpg, drv != "4"), x = year, y = hwy, grouping.var = drv ) # modifying individual plots using `ggplot.component` argument grouped_ggbetweenstats( data = filter( movies_long, genre %in% c("Action", "Comedy"), mpaa %in% c("R", "PG") ), x = genre, y = rating, grouping.var = mpaa, ggplot.component = scale_y_continuous( breaks = seq(1, 9, 1), limits = (c(1, 9)) ) ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.