devtools/GitHub download error - r

As of today I can not use devtools to install a package from GitHub. I don't know if the error lies in:
Me
devtools
GitHub
I'm using install_github as follows and get the following error:
library(devtools)
install_github("reports", "trinker")
## > library(devtools)
## > install_github("reports", "trinker")
## Installing github repo(s) reports/master from trinker
## Installing reports.zip from https://github.com/trinker/reports/archive/master.zip
## Error in function (type, msg, asError = TRUE) :
## transfer closed with outstanding read data remaining
##
## TRIED WITH SECOND REPO:
##
## > install_github("acc.roxygen2", "trinker")
## Installing github repo(s) acc.roxygen2/master from trinker
## Installing acc.roxygen2.zip from https://github.com/trinker/acc.roxygen2/archive/master.zip
## Error in function (type, msg, asError = TRUE) :
## transfer closed with outstanding read data remaining
I tried this with a second repo and get the same error. I know that other similar errors are related to security certificate.
Here's my github repo https://github.com/trinker/reports
I can't seem to download and install either. I can install the tar.gz file produced by an R build though.
Where is the error occurring and why is it occurring?
PS I can install for other people's github:
library(devtools)
install_github("findPackage", "Dasonk")
EDIT
I can install my own qdap as well:
library(devtools)
install_github("qdap", "trinker")

This appears to be a problem with your repo. install_github grabs the .zip file associated with your repository. For some reason yours seems to be an empty .zip file so clearly it can't install.
The tarball doesn't seem to be empty. My guess is that it's just a hiccup in github that should go away with time.

Related

Errors downloading R package for "Efficient R Programming" by Gillespie and Lovelace

the above-referenced book has an associated R package hosted on github containing datasets and functions used in the book.
The book states this code is used to install the package:
devtools::install_github("csgillespie/efficient", build_vignettes = TRUE, dependencies = TRUE)
I receive the following message and errors when running the code:
SUMMARY: processing the following file failed:
'solutions07.Rmd'
Error: Vignette re-building failed.
Execution halted Error: Failed to install 'efficient' from GitHub:
System command 'Rcmd.exe' failed, exit status: 1, stdout & stderr were printed
Do you have any insight into whether the package itself is causing the error versus a local issue on my end? Or how I might figure out the cause and fix for this issue? I appreciate any help you can provide.
This URL provides the section in the online book I am referring to.
https://csgillespie.github.io/efficientR/introduction.html#book-resources
If I run the following code it works:
devtools::install_github("csgillespie/efficient", build_vignettes = TRUE, dependencies = TRUE)
devtools::install_github("csgillespie/efficientR")
I would suggest to reinstall the devtools package using the following code:
remove.packages("devtools")
install.packages("devtools", dependencies = TRUE)
library(devtools)
Was having the same problem. But after installing Rtools for windows: https://cran.rstudio.com/bin/windows/Rtools/rtools42/rtools.html
And installing from source packages that were recommended to update:
recommended packages
Was able to succefully use efficient, and access its vignettes.
Using version R-4.2.1
devtools version 2.4.5

Strange `tinytex` behavior - `~/.TinyTex` keeps dissapearing?

In my rocker/rstudio-derived docker container, I'm engulfed in a quagmire surrounding the yearly TexLive update and the R package tinytex.
I have gone through a plethora of iterations of tinytex::install_tinytex(), tinytex::uninstall_tinytex(), tinytex::reinstall(), etc.
I have installed the most current version via remotes::install_github("yiuhi/tinytex").
I have experimented with different (up to date) mirrors of CTAN.
When using a up to date mirror and having installed/reinstalled tinytex properly, I keep getting this behavior:
> tinytex::tinytex_root()
[1] "/home/rstudio/.TinyTeX"
> tinytex::pdflatex("<MYFILE>.tex")
tlmgr: package repository http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/systems/texlive/tlnet (verified)
[1/1, ??:??/??:??] install: koma-script [13745k]
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /home/rstudio/.TinyTeX/texmf-var/web2c/tlmgr.log
... 6 more successful package installs ...
tlmgr: package repository http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/systems/texlive/tlnet (verified)
[1/1, ??:??/??:??] install: babel-english [3k]
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /home/rstudio/.TinyTeX/texmf-var/web2c/tlmgr.log
! LaTeX Error: This NFSS system isn't set up properly.
! sh: 1: pdflatex: not found
Error: LaTeX failed to compile <MYFILE>.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See <MYFILE>.log for more info.
In addition: Warning messages:
1: In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
error in running command
2: In system2("tlmgr", args, ...) : error in running command
> tinytex::tinytex_root()
[1] ""
After this, ~/.TinyTeX (which was present before) is literally GONE from the file system!?
Can anybody shed light on why 1) tinytex appears to install, 2) it appears to properly process my *.tex file and pulling in the appropriate packages from CTAN and than 3) proceeds in one of those package installations to delete it's entire own installation!?
The observed behavior was a bug in the tinytex R package and has since been resolved (https://github.com/yihui/tinytex/issues/197).
Until the CRAN-available version is >= 0.21.5, one may remedy the behavior by installing directly from the author's repository by:
install.packages("remotes")
remotes::install_github("yihui/tinytex")

Cannot install rstanarm (R crashes)

A similar question was asked here, but I tried the code Tiago Lubiana posts there, to no avail.
I haven't been able to install rstanarm after several attempts. R keeps crashing during the installation.
I did install rstan by running
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
When I want to install rstanarm, nothing seems to work, though. I've tried the following:
1) install.packages("rstanarm"): R crashes and installs a folder called 00LOCK-rstanarm, plus the corresponding rstanarm folder. When I open R, rstanarm is there, but after running library(rstanarm), I get
Error: package or namespace load failed for ‘rstanarm’ in library.dynam(lib, package, package.lib):
shared object ‘rstanarm.so’ not found
By running install.packages("rstanarm") again, I get:
ERROR: failed to lock directory ‘/home/nalerive/R/x86_64-pc-linux-gnu-library/3.5’ for modifying
Try removing ‘/home/nalerive/R/x86_64-pc-linux-gnu-library/3.5/00LOCK-rstanarm’
Warning in install.packages :
installation of package ‘rstanarm’ had non-zero exit status
Deleting that folder has not solved the problem (but see here for a similar error with another package).
2) From here, running
if (!require(devtools)) { install.packages("devtools")
library(devtools) }
install_github("stan-dev/rstanarm", build_vignettes = FALSE)
leads to R crashing again, and the same folders as in 1) are installed. I also get the same error by running library("rstanarm"), namely:
Error: package or namespace load failed for ‘rstanarm’ in library.dynam(lib, package, package.lib):
shared object ‘rstanarm.so’ not found
3) Following this post I tried
install.packages("rstanarm", dependencies = TRUE, repos="http://cran.rstudio.com/", INSTALL_opts = c('--no-lock'))
and R keeps crashing.
I've tried more things, like removing the 00LOCK-rstanarm folder by means of unlink("/home/nalerive/R/x86_64-pc-linux-gnu-library/3.5/00LOCK-rstanarm/", recursive = TRUE); restarting R when indicated; checking my C++ toolchain (as suggested here), etc... but nothing has worked. I really feel hopeless at this point.
I have R version 3.5.2, rstan version 2.19.2, and Linux 4.15.0-1-amd64 #1 SMP Debian 4.15.4-1~mx17+1 (2018-02-23)
Any help will be highly appreciated. Thanks in advance!

Insallation failed on devtools::install_github("rstudio/rmarkdown")

I use R 3.4.3, And I need to install devtools::install_github("rstudio/rmarkdown"). But the following installation error comes up.
Downloading GitHub repo rstudio/rmarkdown#master
from URL https://api.github.com/repos/rstudio/rmarkdown/zipball/master
Installation failed: zip file 'C:\Users\Buster\AppData\Local\Temp\RtmpWyl4FP\file3bc6c571eec.zip' cannot be opened
Warning messages:
1: GitHub repo contains submodules, may not function as expected!
2: In utils::unzip(src, exdir = target) :
error 1 in extracting from zip file
How can I install this?
this has been resolved. I used devtools::install_url("http://cran.r-project.org/src/contrib/rmarkdown_1.9.tar.gz")
As explained in the README for rmarkdown:
If you are working within RStudio then you can simply install the
current release of RStudio (both the rmarkdown package and pandoc are
included).
If you want to use the rmarkdown package outside of RStudio then you
can install the package from CRAN as follows:
install.packages("rmarkdown")
This is a much more concise way of doing:
devtools::install_url("http://cran.r-project.org/src/contrib/rmarkdown_1.9.tar.gz")

How to use install_github

I am trying to calculate weight of evidence and information value, and found online that R package riv and tomasgreif does the job. Both packages are located on github, so I used the following code:
library(devtools)
install_github("riv","tomasgreif")
library(woe)
But it gives me the following error/warning message:
> install_github("riv","tomasgreif")
Installing github repo riv/master from tomasgreif
Downloading master.zip from https://github.com/tomasgreif/riv/archive/master.zip
Error in function (type, msg, asError = TRUE) : couldn't connect to host
In addition: Warning message:
In mapCurlOptNames(names(.els), asNames = TRUE) :
Unrecognized CURL options: writedata
How can I solve this problem?
I tried to download the file manually. R returned no error, but the package is not found in the list... (I am able to install some other packages saved in the same location with similar code)
> install.packages("~/riv.zip", repos = NULL)
> library("riv")
Error in library("riv") : there is no package called ‘riv’
I was able to resolve it via downloading Open Source R from Revolution Analytics, then manually downloaded woe package from git and pasting that directly into library folder of OpenSource R
and loaded it library(woe) it will work
Also based on the same lines will be releasing IV and WOE for python also

Resources