Cannot install package ggpubr

Hello,
i am using RStudio 1.3.959 with R 3.4.4 in OS Linux. In my R Script I want to use the package "ggpubr" but it doesn't work.
Installation of the package is done but several dependencies (and ggpubr) with "non-zero exit status".

Here are my questions:

  1. What do I have to do to get the package installed correctly?
  2. Why does it work on OS Windows-10? There I have no problem...!
  3. Do I have to update the R version 3.4.4 in OS Linux? In Win-10 I use R version 3.6.1

Any advices/ recommendations are welcome! Thank you for your help.

I'd recommend looking closely at the output in your R console, I suspect one of the error messages will tell you a system dependency was missing, with suggestions on how to install it depending on your OS (or not, if the package maintainer didn't add that). On Windows you never have to do this manually, which is why you get this error on Linux only. So the workflow is you go to a command line, install the missing system dependency(ies) and then try the installation in R again.

Now, there's a new tool out there to install packages on Linux without having to think about system dependencies, if I followed correctly: https://blog.rstudio.com/2020/07/01/announcing-public-package-manager/ (I haven't used it myself yet).

Regarding your question about the R version, unless ggpubr or one of its dependencies requires a minimal R version, you don't need to update. I myself am answering whilst updating R :joy:

Hello maelle,
thank you. The install seems to be ok. But the dependency "car" is not available for the R version 3.4.4

library(rstatix)
Fehler in library(rstatix) : es gibt kein Paket namens ‘rstatix’
install.packages("car", dependencies = FALSE)
Installing package into ‘/home/martin/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘car’ is not available (for R version 3.4.4)

What else can I do? The public package manager I don't know how to use it...

The car package requires R 3.5 or higher: https://cran.r-project.org/web/packages/car/index.html

The most recent version of R is 4.0.2 and I would strongly recommend you upgrade from 3.4.4 if you’re able.

You can download the most recent version of R here: https://cloud.r-project.org/

1 Like

For info to upgrade R on Ubuntu I found https://rtask.thinkr.fr/installation-of-r-4-0-on-ubuntu-20-04-lts-and-tips-for-spatial-packages/ very useful. I'm still using Ubuntu 18.04 so had to change "focal" to "bionic". But maybe you don't even use Ubuntu @Martin_Werner.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.