Kyrie NI
Kyrie NI

Reputation: 11

Have trouble installing ggExtra in RStudio

When I try to library "ggExtra" in RStudio with code below:

    install.packages("ggExtra")

what displayed is:

    Warning in install.packages :
    unable to access index for repository 
    https://cran.rstudio.com/src/contrib:
    cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
    Warning in install.packages :
    unable to access index for repository 
    http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
    cannot open URL 
    'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'
    Installing package into ‘C:/Users/Kyrie NI/Documents/R/win-library/3.4’
     (as ‘lib’ is unspecified)

I also tried:

    install.packages("devtools")
    devtools::install_github("daattali/ggExtra")

And I received the same results. What is wrong with my operation, or the package?

Upvotes: 1

Views: 1112

Answers (1)

xiaolin xu
xiaolin xu

Reputation: 11

I had a similar problem using R 3.5.0, and found an online solution working as following. It seems I needed to set a default CRAN mirror by adding the first line. Then I update my R into version 3.5.1 to be able to library it. I hope it helps you too.

   options(repos = c(CRAN = "http://cran.rstudio.com"))
    install.packages("ggExtra")

The original idea comes from: https://support.rstudio.com/hc/en-us/community/posts/205198138-packages-installation-problem

Upvotes: 1

Related Questions