ggstatsplot: remove line connecting mean in ggwithinstats

Viewed 148

I am using ggstatsplot and am trying to remove the line connecting the means in a ggwithinstats plot.

How do I remove the thick red line that connects the means for each group in the plot? (example is from https://mran.microsoft.com/snapshot/2019-12-06/web/packages/ggstatsplot/readme/README.html)

Code:

ggstatsplot::ggwithinstats(data = WRS2::WineTasting,x = Wine,y = Taste, pairwise.comparisons = 
TRUE, pairwise.display = "s", pairwise.annotation = "p", title = "Wine tasting", caption = 
"Data from: `WRS2` R package", ggtheme = ggthemes::theme_fivethirtyeight(), ggstatsplot.layer 
 = FALSE,   messages = FALSE)

violin plot from ggstatsplot

1 Answers

As often, it helps exploring functions with ?. ggstatsplot::ggwithinstats seems a high level function with many, many arguments, some fairly obscurely named. But one of them seemed the right one... Set centrality.path = FALSE

ggstatsplot::ggwithinstats(
  data = WRS2::WineTasting,
  x = Wine,
  y = Taste,
  pairwise.comparisons = TRUE,
  pairwise.display = "s", 
  pairwise.annotation = "p", 
  title = "Wine tasting", 
  caption =
    "Data from: `WRS2` R package", 
  ggtheme = ggthemes::theme_fivethirtyeight(), 
  ggstatsplot.layer = FALSE, messages = FALSE,
  centrality.path = FALSE
)

Created on 2021-11-10 by the reprex package (v2.0.1)

Related