Error in install.packages : cannot open the connection - r

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

Related

Warning in install.packages 'path' is not writable R

I am unable to install any package due to the error mentioned in the title.
I attempt to run the following package :
install.packages("tseries")
However, I then receive the error:
Warning in install.packages 'lib = "C:/Users/santi/OneDrive/Documents/R"' is not writable :
Afterwards, I receive the following pop message:
I proceed to click "yes" bu then I get the following error:
Warning in install.packages cannot create dir 'C:\Users\santi\OneDrive\Documents\R\win-library\3.5\file64444b1a3a3b', reason 'No such file or directory'
I want to be clear that I am using my personal computer and all my settings are set to administrator and I have set all my premissions to my account to "Allow"

install.packages("devtools") fails

I'm new to installing packages and R,
It looks like my devtools library is missing.
I was trying to install swirl,
I got the following message :
> install.packages("swirl")
Installing package into ‘C:/Users/cory/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open destfile 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ\filef6c6874433a', reason 'No such file or directory'); using local file 'C:/PROGRA~1/R/R-35~1.1/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository https://cran.cnr.berkeley.edu/src/contrib:
cannot open destfile 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ\filef6c4b9547', reason 'No such file or directory'
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning messages:
1: package ‘swirl’ is not available (for R version 3.5.1)
2: In gzfile(file, mode) :
cannot open compressed file 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ/libloc_194_4cc5b48b.rds', probable reason 'No such file or directory'
I then tried the following :
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
So I downloaded devtools in zip format and tried loading it
> getwd()
[1] "C:/Users/cory/Documents"
I downloaded the devtools zip in the same folder, and renamed it to devtoolz zip
I tried running the command again
> install.packages("devtools")
Installing package into ‘C:/Users/cory/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open destfile 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ\filef6c77f36a9', reason 'No such file or directory'
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning messages:
1: package ‘devtools’ is not available (for R version 3.5.1)
2: In gzfile(file, mode) :
cannot open compressed file 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ/libloc_194_4cc5b48b.rds', probable reason 'No such file or directory'
What steps should I take to get the devtools installed?
Many thanks! :)
I found a way around this,
In case it helps someone else :
*In Rstudio, it tuns out it is possible to install a package without downloading locally and without pointing to an URL (which I also had tried). Because it is integrated with CRAN-mirrors, I was able to simply type devtools in the box and select it from the existing drop-down menu.
It proved more efficient than trying to manually import it through RGui.*
I had the same issue, I just closed my RStudio and opened it, and it worked.

unable to install caret package in 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")

Trouble install.packages("Hmisc")

So I'm trying to download Hmisc to run a correlation matrix for my dissertation work, and for some reason it won't let me install the package, throwing me this error:
install.packages('Hmisc')
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/src/contrib:
cannot open destfile 'C:\Users\Mia\AppData\Local\Temp\RtmpEbYytB\file39745b63634', reason 'No such file or directory'
Warning in install.packages :
unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
cannot open destfile 'C:\Users\Mia\AppData\Local\Temp\RtmpEbYytB\file39741a4d5c8f', reason 'No such file or directory'
Error in install.packages : cannot open the connection
Anyone have any idea how to make it work?

R "Userfriendlyscience" Package

I am having trouble loading the userfriendlyscience package in R. I am able to load other packages without a problem but this one is giving me the error:
Warning in install.packages : error 1 in extracting from zip file
Warning in install.packages : cannot open compressed file
'BH/DESCRIPTION', probable reason 'No such file or directory' Error in
install.packages : cannot open the connection
Not sure how to resolve the issue.

Resources