Package ‘dplyr’ is not available (for R version 3.4.3)

i wanna install "dplyr" package but i get this error ,

install.packages("dplyr")
      Warning in install.packages :
      unable to access index for repository 
      cannot open URL for PACKAGES
      Installing package into ‘C:/Users/user/Documents/R/win-library/3.4’
      (as ‘lib’ is unspecified)
      Warning in install.packages :
      unable to access index for repository 
      cannot open URL for PACKAGES
      Warning in install.packages :
      package ‘dplyr’ is not available (for R version 3.4.3)
      Warning in install.packages :
      unable to access index for repository
      cannot open URL for PACKAGES

i had to remove the links of the above console statements as the website is not allowing me to do so .

please help me installing dplyr .... been stuck with this for hours ......

Hey @rishi! To me this looks like either:

  1. The install.packages function is defaulting to a weird URL (from which it tries to retrieve the package), or
  2. You're having a connectivity problem (no network, firewall blocking you, etc.)

Do you want to try specifying a repo URL explicitly like:

install.packages('dplyr', repos = 'https://cloud.r-project.org')

If that works, have a look a the output of getOption('repos'), which tells you the repo R is defaulting to.

3 Likes

hi rensa ,

i tried installing packages using the repos , but still i get the same error ,

install.packages('dplyr', repos = '"https://cloud.r-project.org')
Warning in install.packages :
   unable to access index for repository 
   cannot open URL
   Installing package into 
   (as ‘lib’ is unspecified)
   Warning in install.packages : 
   unable to access index for repository 
  scheme not supported in URL 
  Warning in install.packages : 
  package ‘dplyr’ is not available (for R version 3.4.3) 
  Warning in install.packages : 
  unable to access index for repository
  scheme not supported in URL 

i aslo tried finding the default repo , then it shows :

getOption('repos')
                                CRAN                            CRANextra 
                       " cran.rstudio."       "http://www.stats.ox.ac.uk/pub/RWin " 
attr(,"RStudio")
[1] TRUE

There was a spelling mistake in the repos proposed by a previous answer (I've now fixed this).

Try:

install.packages('dplyr', repos = 'https://cloud.r-project.org')

The root cause for your problem is that your CRAN mirror is incorrectly specified.

You can try to fix this by adding the following line of code to the top of your script, or in your .Rprofile.

options(repos = c(CRAN = 'https://cloud.r-project.org'))

If you are using RStudio as your IDE, you can also fix this in the global options, under Tools > Global Options > Packages

3 Likes

Hi Andrie ,
It still shows me the same error .

The error message tells you that the url is unreachable.

Have you access to internet on this environment ? Are you maybe behind a proxy / firewall that you need to configure to go through?

5 Likes

Hello
I have the same problem with package betapart.
@rishi could you solve the problem?
I need help, please.

1 Like

If you are seeing exactly the same error message as above:

Warning in install.packages : 
  unable to access index for repository https://cloud.r-project.org/src/contrib: 
  cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'

then the problem is also with your connection to the internet. As @cderv said, you need to check that you can access the internet from your computing environment and see if you are behind any proxies or firewalls that may be preventing R from accessing the CRAN repository URLs.

If you are getting a different error message then you most likely have a different problem. In that case, please post a new topic including the exact code you ran and the exact error messages you received. Be sure to read our community guidelines for proper code formatting. Please don't post screenshots of code or error messages (as was done above) — they are difficult to read and not searchable.

4 Likes