Can't install ggpubr

What is going wrong here and why can't I install ggpubr? I want to install ggpubr to use ggboxplot and ggline.

Installing 'ggpubr' ...
[1/2] Installing rstatix...
Installing package into 'C:/Users/s166432/Documents/R/win-library/3.5'
(as 'lib' is unspecified)
Warning: dependency 'pbkrtest' is not available
also installing the dependency 'car'

There are binary versions available but the source versions are later:
binary source needs_compilation
car 3.0-7 3.0-8 FALSE
rstatix 0.4.0 0.5.0 FALSE

installing the source packages 'car', 'rstatix'

trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-8.tar.gz'
Content type 'application/x-gzip' length 499932 bytes (488 KB)

downloaded 488 KB

trying URL 'https://cran.rstudio.com/src/contrib/rstatix_0.5.0.tar.gz'
Content type 'application/x-gzip' length 391492 bytes (382 KB)

downloaded 382 KB

ERROR: dependency 'pbkrtest' is not available for package 'car'

  • removing 'C:/Users/s166432/Documents/R/win-library/3.5/car'
    In R CMD INSTALL
    ERROR: dependency 'car' is not available for package 'rstatix'
  • removing 'C:/Users/s166432/Documents/R/win-library/3.5/rstatix'

[2/2] Installing ggpubr...

In R CMD INSTALL

The downloaded source packages are in
'C:\Users\s166432\AppData\Local\Temp\RtmpawIxaU\downloaded_packages'
Installing package into 'C:/Users/s166432/Documents/R/win-library/3.5'
(as 'lib' is unspecified)
Warning: dependency 'pbkrtest' is not available
also installing the dependencies 'car', 'rstatix'

There are binary versions available but the source versions are later:
binary source needs_compilation
car 3.0-7 3.0-8 FALSE
rstatix 0.4.0 0.5.0 FALSE
ggpubr 0.2.5 0.3.0 FALSE

installing the source packages 'car', 'rstatix', 'ggpubr'

ERROR: dependency 'pbkrtest' is not available for package 'car'

  • removing 'C:/Users/s166432/Documents/R/win-library/3.5/car'
    In R CMD INSTALL
    ERROR: dependency 'car' is not available for package 'rstatix'
  • removing 'C:/Users/s166432/Documents/R/win-library/3.5/rstatix'
    In R CMD INSTALL
    ERROR: dependency 'rstatix' is not available for package 'ggpubr'
  • removing 'C:/Users/s166432/Documents/R/win-library/3.5/ggpubr'
    In R CMD INSTALL

The downloaded source packages are in
'C:\Users\s166432\AppData\Local\Temp\RtmpawIxaU\downloaded_packages'

<U+2714> Package 'ggpubr' successfully installed.
Warning messages:
installation of package 'car' had non-zero exit status
installation of package 'rstatix' had non-zero exit status
installation of package 'car' had non-zero exit status
installation of package 'rstatix' had non-zero exit status
5: In utils::install.packages("ggpubr", repos = "XXX") :
installation of package 'ggpubr' had non-zero exit status

library(ggpubr)
Error in library(ggpubr) : there is no package called ‘ggpubr’
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="NA": The system cannot find the file specified

What happens if you try to manually install the missing dependency?

install.packages("pbkrtest")

Than I get this.. However I already installed RTools and updated RStudio

install.packages("pbkrtest")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/

Installing package into ‘C:/Users/s166432/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘pbkrtest’ is not available (for R version 3.5.1)
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="NA": The system cannot find the file specified

What version of RTools have you installed? For your R version you need to install RTools35

Thanks for your help so far.
I have downloaded the new versions of R and RStudio and it seemed to work.
However, now I can't install ggpubr because I get another error:

library(ggpubr)
Registered S3 methods overwritten by 'broom':
method from
augment.rowwise_df
augment.tbl_df
glance.rowwise_df
glance.tbl_df
tidy.rowwise_df
tidy.tbl_df
Error: package or namespace load failed for ‘ggpubr’:
.onLoad failed in loadNamespace() for 'broom', details:
call: loadNamespace(name)
error: there is no package called ‘backports’

I have tried to download the package backports but it does not change the error.

Can you post the message you get when you install backports? Have you tried reseting your R session?

install.packages("backports")
Installing package into ‘C:/Users/s166432/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
backports 1.1.6 1.1.7 TRUE

installing the source package ‘backports’

trying URL 'https://cran.rstudio.com/src/contrib/backports_1.1.7.tar.gz'
Content type 'application/x-gzip' length 17676 bytes (17 KB)
downloaded 17 KB

  • installing source package 'backports' ...
    ** package 'backports' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs

*** arch - i386
"c:/rtools40/mingw32/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsElt.c -o dotsElt.o
sh: c:/rtools40/mingw32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:222: dotsElt.o] Error 127
ERROR: compilation failed for package 'backports'

  • removing 'C:/Users/s166432/Documents/R/win-library/4.0/backports'
    Warning in install.packages :
    installation of package ‘backports’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\s166432\AppData\Local\Temp\RtmpETgpa3\downloaded_packages’

It seems like you haven't installed Rtools40 correctly, if you are using a 32 bit R version you have to also install the 32 bit compiler.

It works now, great! Thanks!

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