Error in loadNamespace(name) : there is no package called ‘ggpubr’

Hi everyones !

I'm facing a problem when using fviz_pca_biplot function. The error message appears :
Error in loadNamespace(name) : there is no package called ‘ggpubr’

I installed ggpubr, and it seams to worked but when I call library(ggpubr) it says that this package is not found. I think I understood that ggpubr was replaced by ggplot2, but why does R look for ggpubr when I'm calling fviz_pca_biplot ? Shouldn't it look for ggplot2 instead ?
I checked latest version of all packages, of R, of Rstudio, and it's all right. Knowing that 2 or 3 months ago it worked perfectly. My script haven't change since, I just reload it to be sure of the results.

Can anyone tell me how to solve it ?

I'm a beginner, and not well in english, so please be indulgent :innocent:
following, my script :

Data <- read.table ( "ACP_PCRS_DS_AV.txt" , h=T , sep="\t", dec =",", row.names = 1 )
Dataf = na.omit(Data)

pca4<- dudi.pca(Dataf, center = T, scale = T, nf = 2, scannf = F)
inertia.dudi(pca4)
fviz_pca_biplot(pca4, col.var = "contrib", gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"), label = "none", repel = T, title = "A : average of all parasites")
summary(pca4)

And then the answer when I install ggpubr package :

Restarting R session...

> install.packages("ggpubr")
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/cloej/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘xfun’, ‘rlang’, ‘tidyselect’, ‘vctrs’, ‘knitr’, ‘dplyr’, ‘pbkrtest’, ‘broom’, ‘car’, ‘rstatix’


  There are binary versions available but the source versions are later:
           binary  source needs_compilation
xfun         0.13    0.19              TRUE
rlang       0.4.5  0.4.10              TRUE
tidyselect  1.0.0   1.1.0              TRUE
vctrs       0.2.4   0.3.6              TRUE
knitr        1.28    1.30             FALSE
dplyr       0.8.5   1.0.2              TRUE
pbkrtest    0.4-7 0.5-0.1             FALSE
broom       0.5.6   0.7.3             FALSE
car         3.0-7  3.0-10             FALSE
rstatix     0.4.0   0.6.0             FALSE
ggpubr      0.2.5   0.4.0             FALSE

  Binaries will be installed
essai de l'URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/xfun_0.13.zip'
Content type 'application/zip' length 184719 bytes (180 KB)
downloaded 180 KB

essai de l'URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.4.5.zip'
Content type 'application/zip' length 1115838 bytes (1.1 MB)
downloaded 1.1 MB

essai de l'URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tidyselect_1.0.0.zip'
Content type 'application/zip' length 242507 bytes (236 KB)
downloaded 236 KB

essai de l'URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/vctrs_0.2.4.zip'
Content type 'application/zip' length 1018801 bytes (994 KB)
downloaded 994 KB

essai de l'URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/dplyr_0.8.5.zip'
Content type 'application/zip' length 3256479 bytes (3.1 MB)
downloaded 3.1 MB

package ‘xfun’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘tidyselect’ successfully unpacked and MD5 sums checked
package ‘vctrs’ successfully unpacked and MD5 sums checked
package ‘dplyr’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\cloej\AppData\Local\Temp\RtmpeuxpZJ\downloaded_packages
installing the source packages ‘knitr’, ‘pbkrtest’, ‘broom’, ‘car’, ‘rstatix’, ‘ggpubr’

essai de l'URL 'https://cran.rstudio.com/src/contrib/knitr_1.30.tar.gz'
Content type 'application/x-gzip' length 887652 bytes (866 KB)
downloaded 866 KB

essai de l'URL 'https://cran.rstudio.com/src/contrib/pbkrtest_0.5-0.1.tar.gz'
Content type 'application/x-gzip' length 245668 bytes (239 KB)
downloaded 239 KB

essai de l'URL 'https://cran.rstudio.com/src/contrib/broom_0.7.3.tar.gz'
Content type 'application/x-gzip' length 618499 bytes (604 KB)
downloaded 604 KB

essai de l'URL 'https://cran.rstudio.com/src/contrib/car_3.0-10.tar.gz'
Content type 'application/x-gzip' length 501293 bytes (489 KB)
downloaded 489 KB

essai de l'URL 'https://cran.rstudio.com/src/contrib/rstatix_0.6.0.tar.gz'
Content type 'application/x-gzip' length 394803 bytes (385 KB)
downloaded 385 KB

essai de l'URL 'https://cran.rstudio.com/src/contrib/ggpubr_0.4.0.tar.gz'
Content type 'application/x-gzip' length 2689307 bytes (2.6 MB)
downloaded 2.6 MB

* installing *source* package 'knitr' ...
** package 'knitr' correctement décompressé et sommes MD5 vérifiées
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace 'xfun' 0.13 is being loaded, but >= 0.15 is required
ERROR: lazy loading failed for package 'knitr'
* removing 'C:/Users/cloej/Documents/R/win-library/3.5/knitr'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘knitr’ had non-zero exit status
* installing *source* package 'broom' ...
** package 'broom' correctement décompressé et sommes MD5 vérifiées
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace 'dplyr' 0.8.5 is being loaded, but >= 1.0.0 is required
ERROR: lazy loading failed for package 'broom'
* removing 'C:/Users/cloej/Documents/R/win-library/3.5/broom'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘broom’ had non-zero exit status
ERROR: dependencies 'broom', 'knitr' are not available for package 'pbkrtest'
* removing 'C:/Users/cloej/Documents/R/win-library/3.5/pbkrtest'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘pbkrtest’ had non-zero exit status
ERROR: dependency 'pbkrtest' is not available for package 'car'
* removing 'C:/Users/cloej/Documents/R/win-library/3.5/car'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘car’ had non-zero exit status
ERROR: dependencies 'broom', 'car' are not available for package 'rstatix'
* removing 'C:/Users/cloej/Documents/R/win-library/3.5/rstatix'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘rstatix’ had non-zero exit status
ERROR: dependency 'rstatix' is not available for package 'ggpubr'
* removing 'C:/Users/cloej/Documents/R/win-library/3.5/ggpubr'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘ggpubr’ had non-zero exit status

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

thanks a lot for any help you could give me :smiley:

I'm sure it can be overwhelming to go through such a log, but a good heuristic is search for the first error and try to address that, before repeating the code.
In your case install the latest xfun package

thank's for youre answer.

I found out that I had an old version of R. That explain why I had the old version of all the other package. It finally worked ! :smiley:

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.