Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install packages in latest version of RStudio and R Version.3.1.1 [duplicate]

Tags:

r

I am unable to install packages through latest version of RStudio and R Version.3.1.1. Kindly help. I got the error as mentioned below:

Example: Warning in install.packages :   InternetOpenUrl failed: '' Warning in install.packages :   InternetOpenUrl failed: '' Warning in install.packages :   unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1 Installing package into ‘C:/Users/Documents/R/win-library/3.1’ (as ‘lib’ is unspecified) Warning in install.packages :   InternetOpenUrl failed: '' Warning in install.packages :   InternetOpenUrl failed: '' Warning in install.packages :   unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1 Warning in install.packages :   package ‘reshape’ is not available (for R version 3.1.1) 
like image 685
manjula sridhar Avatar asked Sep 01 '14 06:09

manjula sridhar


People also ask

Why my RStudio Cannot install packages?

Solution 2: Use RStudioChanging the configuration in R Studio to solve install packages issue. Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”. For other RStudio issues refer to official Troubleshooting Guide here.

What happens if you install a package twice in R?

I wonder, can I do any harm to my system (or the stability of R installation) if I install some package twice. Or when installing a new package it will simply overwrite the previous version. It shouldn't be an issue unless you install a package as an admin user, and again as a normal user.

How do I install the latest version of a package in R?

If you only want to update a single package, the best way to do it is using install. packages() again. In RStudio, you can also manage packages using Tools -> Install Packages.

How do I install the latest version of R in RStudio?

If you want to update to the latest version of RStudio, hover over “Help” on the top menu bar of your Mac, and click “Check for Updates”. Then, quit the RStudio program, go to the RStudio website, and download and install the latest version. Now you should have the latest versions of R and RStudio on your computer.


1 Answers

Not 100% certain that you have the same problem, but I found out the hard way that my job blocks each mirror site option that was offered and I was getting errors like this:

Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- Error in download.file(url, destfile = f, quiet = TRUE) :    unsupported URL scheme Warning: unable to access index for repository https://rweb.crmda.ku.edu/cran/src/contrib Warning message: package ‘ggplot2’ is not available (for R version 3.2.2) 

Workaround (I am using CentOS)...

install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/') 

I hope this saves someone hours of frustration.

like image 72
cer Avatar answered Oct 08 '22 14:10

cer