0

I have the feeling that R is not working properly on my system.

I want to use an interaction plot to present my two-way ANOVA results. So I used the package ggpubr and am plotting with ggline using the example with multiple factors. It did not show the errorbars properly, instead of showing them for each factor, it grouped the factors, and the bars also appear black (see pictures below).

So I tested it with the exact example as in the package description (http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/79-plot-meansmedians-and-error-bars):

library(ggpubr)    
ggline(ToothGrowth, x = "dose", y = "len", 
           add = c("mean_se", "jitter"),
           color = "supp", palette = "jco")

Which SHOULD give me this graph:

Graph from working example

However, on my system I get this:

Graph on my system

I already:

  • updated the ggpubr package and all other packages
  • completely re-installed R from scratch
  • asked the package developer, it seems to be no package-bug cause it works for him

Can someone reproduce the same problem? I really don't know how to solve it and I also get the feeling that R might mess up other graphs as well.

Thanks a lot.

MrFlick
  • 195,160
  • 17
  • 277
  • 295
Induriel
  • 1
  • 2
  • Same here. I see the same problem with R 3.5.1 (2018-07-02) and ggpubr 0.1.8 (2018-08-30). The "mean_se" was not properly grouped. – Bing Nov 08 '18 at 17:38
  • 1
    This has been fixed in the development version, as indicated in this [GitHub issue](https://github.com/kassambara/ggpubr/issues/109). What that means is the CRAN version still has the bug but the most recent GitHub version does not. You can install from GitHub via `devtools::install_github("kassambara/ggpubr")`. I just updated to this and, indeed, the problem appears to be fixed. – aosmith Nov 08 '18 at 17:45
  • @aosmith the dev version indeed fixed the bug. Thanks. – Bing Nov 08 '18 at 18:01
  • Yes, I can confirm that the updated version is producing the correct graph. Thanks a lot for this fast support on this. Awesome :-) – Induriel Nov 10 '18 at 00:47

1 Answers1

0

Try this :

ggline(ToothGrowth, x = "dose", y = "len", 
       add = c("mean_se", "jitter"),
       color = "supp", add.params = list(group="supp"), palette = "jco")