Is MRAN broken? - r

I have been trying to install packages from MRAN, specifically bsts amoung others. If I run:
install.packages(c("Boom","BoomSpikeSlab", "bsts"),repos = "https://mran.revolutionanalytics.com/snapshot/2016-01-01/")
I get the following output:
Warning in install.packages :
URL 'https://mran.revolutionanalytics.com/snapshot/2016-01-01/bin/macosx/mavericks/contrib/3.3/PACKAGES.gz': status was '404 Not Found'
Warning in install.packages :
URL 'https://mran.revolutionanalytics.com/snapshot/2016-01-01/bin/macosx/mavericks/contrib/3.3/PACKAGES': status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://mran.revolutionanalytics.com/snapshot/2016-01-01/bin/macosx/mavericks/contrib/3.3:
cannot download all files
Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘Boom’ ‘BoomSpikeSlab’ ‘bsts’
Do you want to attempt to install these from sources?
y/n:
I also get the same result when changing the repository location using options(). A simple solution would be simply to install from source as below:
install.packages(c("Boom","BoomSpikeSlab", "bsts"),repos = "https://mran.revolutionanalytics.com/snapshot/2016-01-01/",type = "source")
However what doesn't make sense is that, when you check the repository on your browser, the binaries appear to be available:
https://cran.r-project.org/web/packages/bsts/index.html (CRAN)
https://mran.revolutionanalytics.com/snapshot/2016-01-01/web/packages/bsts/index.html (MRAN)
Additionally I would prefer not to have to compile the source code, especially as R's compiler is out of date...
Previous stack overflow questions have suggested this is because the repository is down, however this doesn't make sense as the binaries can be accessed through the browser. So is there an issue with MRAN, is there an issue with install.packages?
I should note I have tried executing this code in both RStudio and R through the terminal. Additionally, for reference, this is my system details:
platform x86_64-apple-darwin13.4.0
arch x86_64
os darwin13.4.0
system x86_64, darwin13.4.0
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31)
nickname Sincere Pumpkin Patch
Thanks in advance for the help.

I've now solved this problem. When calling from the MRAN repository using install.packages you need to capitalise "MRAN" part of the URL.
So this works:
install.packages("bsts", repos = "https://MRAN.revolutionanalytics.com/snapshot/2016-06-01/")
And this only works from source:
install.packages("bsts", repos = "https://mran.revolutionanalytics.com/snapshot/2016-06-01/")

Related

Failure to install package from github using devtools

I am unable to install a package from GitHub. SCCRWP/ASCI. This is a model for assessing stream health using algal community composition. First my session info:
- Session info ------------------------------------------------------------------------------
setting value
version R version 4.1.3 (2022-03-10)
os Windows 10 x64 (build 19044)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/Los_Angeles
date 2022-06-28
rstudio 2022.02.3+492 Prairie Trillium (desktop)
pandoc NA
I will run the following:
library(devtools)
curl::ie_proxy_info()
install_github('SCCWRP/ASCI')
I have to run curl: whenever I use an API or github due to work's system settings. I get the following error message.
Downloading GitHub repo SCCWRP/ASCI#HEAD
SCCWRP-ASCI-82bd614/mmilkup.RData: truncated gzip input
tar.exe: Error exit delayed from previous errors.
Error: Failed to install 'ASCI' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
In addition: Warning messages:
1: In utils::untar(tarfile, ...) :
‘tar.exe -xf "C:\Users\nmack\AppData\Local\Temp\RtmpOcZ5L9\file53d87e726d5b.tar.gz" -C "C:/Users/nmack/AppData/Local/Temp/RtmpOcZ5L9/remotes53d8228135e9"’ returned error code 1
2: In system(cmd, intern = TRUE) :
running command 'tar.exe -tf "C:\Users\nmack\AppData\Local\Temp\RtmpOcZ5L9\file53d87e726d5b.tar.gz"' had status 1
I contacted the package's author and was advised to download the repo and install locally. I received an error when installing locally stating that a dependency was missing. Upon installing the missing dependency I was successful => open the .Rproj file => hitting 'ctrl+shft+b'. The problem did not lie in the missing dependency since I am still unable to install with install_github('SCCWRP/ASCI'). The same error above returns. The author above(do not know his SOF handle) gave me two links of similar issues.
NOAA/VAST and SOF. From reading the resolution in one case it would seem a reduced DESCRIPTION would be a solution. The author replied, "I reduced the Description line in the DESCRIPTION file in the ASCI package to one line, so it would be interesting to see if you get the same error again", but I am getting the same error.
Not sure if this matters, but I can not seem to install from a .zip either. When I run:
install.packages("C:/Users/nmack/Downloads/ASCI-master.zip", repos = NULL, type = "win.binary")
I get a quick flash, no error message/notice and no package installed.

GnuTLS Error -50: Cannot install packages from Github in Rstudio?

The following lines prompt an error (which differs from this question):
library(devtools)
install_github("StatsWithR/statsr") # the same for any other open repos
The error is this:
Error: Failed to install 'unknown package' from GitHub:
Error -50 setting GnuTLS cipher list starting with +VERS-TLS1.3
Then I wanted to work around the problem caused by devtools, so I tried githubinstall, but the error became this:
Error in curl::curl_download(input, tmpFile, mode = "wb", quiet = !showProgress) :
Error -50 setting GnuTLS cipher list starting with +VERS-TLS1.3
It seems obvious that the issue is caused by GnuTLS and I found a similar thread: git/jenkins TLS issue, but I cannot find some hints there.
I also tried install_url, install_local, and install_git, but all failed.
Here is the information of the R I recently upgraded from 3.4.4(2018):
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 4
minor 1.2
year 2021
month 11
day 01
svn rev 81115
language R
version.string R version 4.1.2 (2021-11-01)
nickname Bird Hippie
I have been stuck with devtools and install_github. What can I try next?
I installed the r-base and Rstudio using apt install in an existing container, and the default settings(the default r version is 3.4.4) caused the issues I met, then I purged the r environment and created a new one in a new Docker container following this blog: Running RStudio Server with Docker.

R - Unable to install R packages - Cannot open the connection

Before you mark this as duplicate, I wish to say that I already referred the related post 1,post 2, 3, 4
I am trying to install the dplyr and stringr package but i get the below error
Warning in install.packages :
downloaded length 139264 != reported length 3227450
Warning in install.packages :
error 1 in extracting from zip file
Warning in install.packages :
cannot open compressed file 'dplyr/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
I tried different installation commands like
install.packages(“dplyr”)
install.packages(“dplyr”, repos="http://cran.us.r-project.org")
install.packages(“dplyr”, repos="http://cran.us.r-project.org",type="win.binary")
> Sys.info()
sysname release version machine
"Windows" "10 x64" "build 17134" "x86-64"
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 6.2
year 2019
month 12
day 12
svn rev 77560
language R
version.string R version 3.6.2 (2019-12-12)
nickname Dark and Stormy Night
Till yesterday, I was able to install this package successfully. But today it is throwing this error.
This error happens with other packages like stringr as well. I tried chaging CRAN mirrors as well but still no help
Can help please?
I have downloaded a R package and installed from local files. Next I tried to install a package, with many imports, through Install package(s), I could not install. I closed R and restarted R, now I am able to install packages, with many imports. Rahul, R user.
This error typically happens because R cannot access the default directory for installing the packages. This error is a system-related error. Try this solution. It worked out for me. I changed the default installation directory in the environment variables and it worked smoothly.

Installing H2o-3 in R

I use the following code to install h2o-3 in R
# The following two commands remove any previously installed H2O packages for R.
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) }
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") }
# Next, we download packages that H2O depends on.
pkgs <- c("methods","statmod","stats","graphics","RCurl","jsonlite","tools","utils")
for (pkg in pkgs) {
if (! (pkg %in% rownames(installed.packages()))) { install.packages(pkg) }
}
# Now we download, install and initialize the H2O package for R.
install.packages("h2o", type="source", repos=(c("http://h2o-release.s3.amazonaws.com/h2o/rel-turing/3/R")))
library(h2o)
localH2O = h2o.init(nthreads=-1)
# Finally, let's run a demo to see H2O at work.
demo(h2o.kmeans)
It shows the following error.
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\pintoo\AppData\Local\Temp\RtmpUxsC47/downloaded_packages/h2o_3.10.0.3.tar.gz' had status 65535
Warning in install.packages :
installation of package ‘h2o’ had non-zero exit status
Then, as the above code, doesn't install package, and it shows it has been downloaded so i tried installing using the downloaded package using the below code
install.packages("C:/Users/pintoo/AppData/Local/Temp/RtmpUL3Da2/downloaded_packages/h2o_3.10.0.3.tar.gz",
repos = NULL, type = "source", dependencies = T)
It produced the below error
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" "C:/Users/pintoo/AppData/Local/Temp/RtmpUL3Da2/downloaded_packages/h2o_3.10.0.3.tar.gz"' had status 65535
Warning in install.packages :
installation of package ‘C:/Users/pintoo/AppData/Local/Temp/RtmpUL3Da2/downloaded_packages/h2o_3.10.0.3.tar.gz’ had non-zero exit status
MY version :
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 3.1
year 2016
month 06
day 21
svn rev 70800
language R
version.string R version 3.3.1 (2016-06-21)
nickname Bug in Your Hair
Can any one help me out.
What is this non-zero exit status.
status 65535 meaning?
Non- zero exit status of package means?
The error message you gave is for the second of your two install lines; you don't say what happened with the first one.
But, my recommended way to install H2O on R:
install.packages("h2o")
Simple! This will get the latest version from CRAN, and automatically find all the dependencies. The downside is you are a version or so behind the latest. But the product is mature (so being a version back is fine) and development is fairly rapid (so being a version back can sometimes even be better)!
Only use the instructions on the H2O site if you have a good reason to need the latest version. (And I still recommend installing the first time from CRAN, as it is harder to get something wrong, so if that doesn't work, maybe H2O is incompatible with your machine or something like that.)
P.S. The 65535 (i.e. -1) error code is probably a Windows one, and from some googling appears to be a generic one meaning something crashed. If you do pursue it, I'd be suspicious about either access permissions to certain directories, or paths with spaces in them. (IIRC, R used to recommend not installing in directories with spaces in them.)

Why can't I install the XML package

Am I making some basic error here?
install.packages("XML")
Warning in install.packages :
package ‘XML’ is not available (for R version 2.13.0)
Installing package(s) into ‘C:/Program Files/R/R-2.13.0/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘XML’ is not available (for R version 2.13.0)
It is probably because www.omegahat.org doesn't exist anymore. So,
command install.packages("XML", repos = "http://www.omegahat.org/R")
does not work. Instead use below:
install.packages("XML", repos = "http://www.omegahat.net/R")
There can be two conditions when you see such error:
The package does not exist in the library (you should install it
from it's own library)
The package is not compatible with your R
version (you should change your R version that is compatible, if you
can afford it)
For the first condition, search on internet and read about the package you want to install and check the provider and repository (for this case, XML, it is official R package)
For the second condition, you can find the information in the following link:
http://cran.r-project.org/web/packages/XML/index.html
you can check your R version by typing the following command into your R shell:
version
which will give you all the information, for e.g:
_
platform x86_64-apple-darwin10.8.0
arch x86_64
os darwin10.8.0
system x86_64, darwin10.8.0
status
major 3
minor 0.1
year 2013
month 05
day 16
svn rev 62743
language R
version.string R version 3.0.1 (2013-05-16)
nickname Good Sport
First update the R-core:
version
install.package('installr')
library(installr)
updateR()
Then install the XML module:
install.packages("XML")
What worked for me is downloading the old release of the XML package and installing from the package archive
install.packages("~/R/win-library/3.6/XML_3.99-0.3.zip", repos = NULL, type = "win.binary").

Resources