unable to install caret package in R - r

When I try to install caret package in R I get the following error message:
utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'); using local file 'C:/PROGRA~1/R/R-34~1.0/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository https://rweb.crmda.ku.edu/cran/src/contrib:
cannot open URL 'https://rweb.crmda.ku.edu/cran/src/contrib/PACKAGES'
Warning: 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'
Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
no packages were specified
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
InternetOpenUrl failed:
How can I solve it?

Try any of the following methods:
Edit: changed https to http
install.packages("http://cran.r-project.org/src/contrib/caret_6.0-80.tar.gz",
repos=NULL, method="libcurl")
or
library(devtools)
install_url("http://cran.r-project.org/src/contrib/caret_6.0-80.tar.gz")

Related

Failed to download mirror file in R programing language (version 3.5)

I facing problem to install any package in R programing language.
install.packages("nnet")
after hitting enter to run the above code, getting the following:
Installing package into ‘C:/Users/Acer/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'); using local file 'C:/PROGRA~1/R/R-34~1.2/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository
https://ftp.iitm.ac.in/cran/src/contrib: cannot open URL
'https://ftp.iitm.ac.in/cran/src/contrib/PACKAGES' Warning: unable to
access index for repository
https://ftp.iitm.ac.in/cran/bin/windows/contrib/3.4: cannot open URL
'https://ftp.iitm.ac.in/cran/bin/windows/contrib/3.4/PACKAGES' Warning
messages:
1: In download.file(url, destfile = f, quiet = TRUE) :
InternetOpenUrl failed: 'The connection with the server was reset'
2: package ‘nnet’ is not available (for R version 3.4.2)
I am not able to fix the problem. Can anyone help me on this issue, please?

Error in install.packages : cannot open the connection

I am trying to install a R package from zip file using code below:
install.packages("M:/packages/predictCRIS.zip", repos = NULL, type = "win.binary")
I get following error in R
Warning in install.packages :
cannot open compressed file 'predictCRIS/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
Can someone have try to install/troubleshoot it?
link to the package in google drive:
download

Issue with package installation of gganimate

I want to install gganimate, but as I work behind a firewall in a corporate setting, install_github is not an option as it returns:
install_github("dgrtwo/gganimate")
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Couldn't resolve host nam
I have tried to install it mannually, but the result I get is:
install.packages("C:/Users/stefanj/Downloads/gganimate.zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/stefanj/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open compressed file 'gganimate/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
I found a work-around for a different library (rCharts):
library(downloader)
download("https://github.com/ramnathv/rCharts/archive/master.tar.gz", "rCharts.tar.gz")
install.packages("rCharts.tar.gz", repos = NULL, type = "source")
But I can't find the tar.gz file for gganimate. I only have a zip file. Anyone knows how I can install source from a zip or where I can find the actuall tar.gz file for gganimate?
I have tried
install.packages("gganimate.zip", repos = NULL, type = "source")
but it failed.

R - cannot access urls for package installation

I recently installed R Studio (Version 0.99.892) on a personal computer (windows 8) and am trying to install, among others, the following packages:
ggplot2;
dplyr;
rmarkdown;
tidyr.
Neither R nor R Studio is able to install any of these packages. Each time I attempt to install a package, I get the set of warnings I include at the bottom of this post.
I have used the install.packages command as well as the built-in package installation tool. I have tried several different mirrors.
I have tried a public university internet source, my own private internet source, and a phone tether. I have tried to connect through a VPN. I have added R Studio to my Windows Firewall exception list and have also completely disabled the Windows Firewall. I am running no other firewalls.
I have toggled the various connection options in the "Packages" tab in Global Options.
I can access the URLs in a browser.
Here are the warnings from R Studio:
> install.packages("devtools")
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
unable to access index for repository https://cran.fhcrc.org/src/contrib:
cannot open URL 'https://cran.fhcrc.org/src/contrib/PACKAGES'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
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/Nikhailovich/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
unable to access index for repository https://cran.fhcrc.org/src/contrib:
cannot open URL 'https://cran.fhcrc.org/src/contrib/PACKAGES'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
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'
Warning in install.packages :
package ‘devtools’ is not available (for R version 3.2.3)
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
unable to access index for repository https://cran.fhcrc.org/bin/windows/contrib/3.2:
cannot open URL 'https://cran.fhcrc.org/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.2:
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.2/PACKAGES'
Here are the warnings from R (3.2.3):
> install.packages("ggplot2")
Installing package into ‘C:/Users/Nikhailovich/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning: unable to access index for repository https://dirichlet.mat.puc.cl/src/contrib:
cannot open URL 'https://dirichlet.mat.puc.cl/src/contrib/PACKAGES'
Warning: 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'
Warning: unable to access index for repository https://dirichlet.mat.puc.cl/bin/windows/contrib/3.2:
cannot open URL 'https://dirichlet.mat.puc.cl/bin/windows/contrib/3.2/PACKAGES'
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.2:
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.2/PACKAGES'
Warning message:
package ‘ggplot2’ is not available (for R version 3.2.3)
There are several stackexchange posts on package installation in R and R Studio, but I was not able to find any that answered my particular situation. Thanks in advance to anyone that knows what's going on
Run this command:
options(repos="https://CRAN.R-project.org")
after that try install.packages;it should work.Tested on my system.
This has happened to me before. Try explicitly specifying the location:
install.packages("devtools", repos="https://cran.rstudio.com/")
You can indeed specify the location when using the install.packages() function with the argument repos=, but you can also choose your favorite repository which will be used each time you download a package.
options(repos="my_favorite_CRAN_mirror")
You can see a list of all availables mirrors on the CRAN website. Juste copy/paste the adress of the closest CRAN repository to you.
You should be able after this step to retry install.packages('ggplot2')
You should try following code:
install.packages("ggbiplot",dependencies = TRUE, repos = 'http://cran.rstudio.com/')
It will help you to install the packages for the error:
package is not available for this version
Run the following command in R terminal-
options(repos="https://CRAN.R-project.org")
then-
use-install.packages('library')
I want to add that I had this issue, but the fix was not in R, but in our system. Our IT guy said: For some unknown reason, the DNS resolver service was unable to resolve hostnames. I’ve restarted the resolvd service. The server can now resolve hostnames.
The error on his end was: Temporary failure in name resolution
I was having a similar error while trying to install the packages dplyr, tidyr packages.
I solved the issue by checking my R.version and downloading a new version of base R. (3.3.3)
Try this...
Tools-->Global Option--> Package
Change "Primary CRAN Repository" to htpps Location
This method fixed my issue

rJava installation from local directory in windows

I installed R 2.11.1 and am running java 1.7.0
I downloaded the rJava source file rJava_0.8-8.zip from
http://cran.us.r-project.org/bin/windows/contrib/2.11/
and ran install.packages("rJava_0.8-8.zip",repos=NULL,type="source") in R from the directory containing the file. But I am getting the following lines as error:
Warning in install.packages("rJava_0.8-8.zip", repos = NULL, type = "source") :
argument 'lib' is missing: using 'C:\Users\Shiladitya\Documents/R/win64-library/2.11'
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :
object 'unpackPkgZip' not found
Warning message:
In install.packages("rJava_0.8-8.zip", repos = NULL, type = "source") :
installation of package 'rJava_0.8-8.zip' had non-zero exit status
I'm being unable to install rJava the usual way by doing
install.packages('rJava', .libPaths()[1], repos="http://cran.us.r-project.org")
since that is leading to an error message like this:
Warning: unable to access index for repository http://cran.us.r-project.org/bin/windows64/contrib/2.11
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘rJava’ is not available
Please help!

Resources