Devtools Install_github failes for Reprtree - r

Searched the whole internet, but couldn't find a solution.
Wrestling now for hours with this problem.
library(devtools)
install_github("araastat/reprtree")
But I receive an error every time (tried multiple things, like restarting, turn off my vpn).
Installation failed: Command failed (1)
Warning message:
S3 methods ‘[.git_tree’, ‘as.POSIXct.git_time’, ‘as.character.git_time’, ‘as.data.frame.git_commit’,
‘as.data.frame.git_repository’, ‘as.data.frame.git_tree’,
‘as.list.git_tree’, ‘diff.git_repository’, ‘diff.git_tree’,
‘format.git_blob’, ‘format.git_commit’, ‘format.git_merge_result’,
‘format.git_note’, ‘format.git_signature’, ‘format.git_tag’,
‘head.git_repository’, ‘length.git_blob’, ‘length.git_diff’,
‘length.git_tree’, ‘merge.character’, ‘merge.git_branch’,
‘merge.git_repository’, ‘plot.git_repository’, ‘print.git_blob’,
‘print.git_branch’, ‘print.git_commit’, ‘print.git_config’,
‘print.git_diff’, ‘print.git_merge_result’, ‘print.git_note’,
‘print.git_reference’, ‘print.git_reflog’, ‘print.git_reflog_entry’,
‘print.git_repository’, ‘print.git_signature’, ‘print.git_status’,
‘print.git_tag’, ‘print.git_time’, ‘print.git_tree’, ‘sha.git_blob’,
‘sha.git_branch’, ‘sha.git_commit’, ‘sha.git_fetch_head’,
‘sha.git_merge_result’, ‘sha.git_note’, ‘sha.git_reference’,
‘sha.git_reflog_entry’, [... truncated]
Edit. Another approach (as mentioned in the comments)
devtools::install("reprtree-master")
Installing reprtree
"C:/PROGRA~1/R/R-34~1.4/bin/i386/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/asdf/Downloads/reprtree-master" --library="C:/Users/asdf/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'reprtree' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
converting help for package 'reprtree'
finding HTML links ... done
ReprTree html
finding level-2 HTML links ... done
plot.getTree html
plot.reprtree html
reprtree-package html
snip.depth html
text.tree html
Error: C:/Users/asdf/Downloads/reprtree-master/man/text.tree.Rd:41: Bad \link text
* removing 'C:/Users/asdf/Documents/R/win-library/3.4/reprtree'
In R CMD INSTALL
Error: Command failed (1)
>

For future readers
Something is wrong in text.tree.RD at line 41. What I did propably isn't the most perfect solution, but it works.
You can download the package as a .zip and unzip it. Then remove everything after line 39 in ./man/text.tree.RD. Afterwards you can install the package like this:
library(devtools)
if(!('reprtree' %in% installed.packages())){
install_local('path_to_extracted_zip/reprtree-master/')
}

Try devtools but from different sources:
install.packages('devtools', repos = 'http://cran.us.r-project.org')
library(devtools)
devtools::install_github('skinner927/reprtree')
library(reprtree)

Related

Installing R package ERROR: installing binary package failed

Complete newbie here, so there is probably something glaringly bad here. I created a Project following Hadley Wickham's book on R packages, and now I am trying add it to github for remote install (repository for reference).
Running devtools::install_github("alutterb/abcmlr") generated the following output:
Downloading GitHub repo alutterb/abcmlr#master
√ checking for file 'C:\Users\amlut\AppData\Local\Temp\RtmpMpn5uJ\remotes7146c405dd7\alutterb-abcmlr-918bf05/DESCRIPTION' ...
- preparing 'abcmlr':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'abcmlr_0.1.0.tar.gz'
Installing package into ‘C:/Users/amlut/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *binary* package 'abcmlr' ...
cp: unknown option -- )
Try '/Rtools/bin/cp --help' for more information.
ERROR: installing binary package failed
* removing 'C:/Users/amlut/Documents/R/win-library/3.5/abcmlr'
In R CMD INSTALL
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/amlut/AppData/Local/Temp/RtmpMpn5uJ/file71463953e7b/abcmlr_0.1.0.tar.gz’ had non-zero exit status
In my repository, I have a Linux executable that is to be used with wsl as well as an .exe file that is called in my R code. These may be the culprits, but I am not entirely sure. The error states that it failed to install the binary package, but install_github() takes a source package, so I am not sure what is going on. Any help is appreciated.
Thank you.
EDIT: This problem is solved. It was because of a line in my DESCRIPTION file that had to do with Built.
Check your %PATH% and type: where cp.
Another cp (like one from the Git for Windows distribution) might overshadow the RTools cp, which might explain the error message.
As commented by the OP hkj447, the error was trigger by a line in the DESCRIPTION file:
Built: R 3.5.3; ; 2019-06-14 21:17:43 UTC; windows
As seen in this thread:
You have a field called 'Built:' in your package's DESCRIPTION file;
R normally tries to inject that field itself when it builds your package from sources.
I deleted "Built"'s line in DESCRIPTION and then installed again.
This time, no error appeared.

checkCompilerOptions Error while installing package (littler/Docker)

On its last line, this Docker file calls littler::install.r to install Rcpp RcppEigen and matrixStats.
The whole code was working like a charm a couple of months back. Now, it bombs at that last step. More precisely, Rcpp and RcppEigen still install perfectly, but when it comes to installing matrixStats, I get:
installing to /usr/local/lib/R/site-library/matrixStats/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :
object 'checkCompilerOptions' not found
Calls: ::: -> get
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/matrixStats’
The downloaded source packages are in
‘/tmp/downloaded_packages’
Warning message:
In install.packages(f, lib, if (isMatchingFile(f)) NULL else repos) :
installation of package ‘matrixStats’ had non-zero exit status
It's an error I never had before and have trouble locating where it is even coming from. What could be causing this problem? Any info would already help a lot.
However, with R-devel using rocker/r-devel,
docker run --rm -ti rocker/r-devel /bin/bash
RD
install.packages("matrixStats")
Gives the same error. I'm guessing this is another R-devel change which takes away things we took for granted before, in this case something to do with compiler package. I don't however have a solution, yet. Just (re-)installing or attaching compiler doesn't help.
Update
Using R CMD INSTALL --no-byte-compile allows backports to install for me, which was the package I was having trouble with.
From the top of my head I'd blame a change in matrixStats [ but see below and it appears blameless ] -- I am somewhat familiar with all the other moving parts and not aware of changes or bugs.
One thing that is fishy though is the trailing line break:
RUN install.r Rcpp RcppEigen matrixStats \
You may try without it.
Edit: And for what it is worth I just fired up our standard base layer Docker image r-base via
docker run --rm -ti r-base /bin/bash
and invoked
install.r Rcpp RcppEigen matrixStats
which executed just fine.
So if sonething is wrong with that other Docker container you may have to take it up with its author and work through his changes relative to our Dockerfile he seems to have used as a base.

R version 3.0.2 cannot find RCurl package

I'm using R version 3.0.2 on my Windows 7 (32-bit) system and am stumped trying to install rCharts. I've had no problem installing other packages from github (e.g., slidify), but R seems unable to find the dependent RCurl package I installed.
I can submit the following basic lines of code without error:
require(devtools)
library(bitops,lib.loc='c:/R/packages/')
library(RCurl,lib.loc='c:/R/packages/')
require(RCurl) # have also tried the library function without luck*
But, when I submit the command to install rCharts with
install_github('rCharts', 'ramnathv')
I get the following :
Installing github repo(s) rCharts/master from ramnathv
Downloading rCharts.zip from https://github.com/ramnathv/rCharts/archive/master.zip
Installing package from C:\Users\nakamura\AppData\Local\Temp\RtmpwzYzaG/rCharts.zip
Installing rCharts
"C:/PROGRA~1/R/R-30~1.2/bin/i386/R" --vanilla CMD INSTALL \
"C:\Users\nakamura\AppData\Local\temp\RtmpwzYzaG\rCharts-master" \
--library="C:/Program Files/R/R-3.0.2/library" --with-keep.source \
--install-tests
**ERROR: dependency 'RCurl' is not available for package 'rCharts'**
*** removing 'C:/Program Files/R/R-3.0.2/library/rCharts'
Error: Command failed (1)**
I've tried installing libcurl, but am not sure I've unzipped it to the correct folder. (From what I've been able to gather from bits and pieces of other questions about rCurl, it seems having an improper/no installation of libcurl could be a contributing factor?)
Any help would be very much appreciated. I feel like I'm going around in circles.
Ann
Adding the directory "C:/R/packages" to the front of the .libPaths variable will help R find RCurl if it's been installed to a non-standard directory.

R - devtools Github install fails

Trying to use Hadleys devtools package I am getting a certification error:
install_github("devtools")
Installing github repo(s) devtools/master from hadley
Installing devtools.zip from https://github.com/hadley/devtools/archive/master.zip
Error in function (type, msg, asError = TRUE) :
Peer certificate cannot be authenticated with given CA certificates
Google search tells me that this is a curl issue. I am no nearer.
Using "git" from the command line I can pick up anything I want from github, - I don't get this error. It only appears when I try to connect to github from R.
I am using ubuntu 12.10, libcurl 7.22.0 and R 3.0
Does anyone have an idea what to do to fix this?
Sincerely
H.
This issue is resolved. There was some mismatch between the version of RCurl and the curl library. Re-installing RCurl fixed the problem.
Try
$ git clone git://github.com/hadley/devtools.git
$ R CMD build devtools
$ R CMD install devtools_1.2.99.tar.gz
or just
$ git clone git://github.com/hadley/devtools.git
$ R CMD install devtools
both worked for me on Ubuntu 12.04. Someone else can weigh in on whether there's any difference in building first then installing from tarball or not. I would guess no, but I have no idea
edit:
trying this on os X
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library’
* installing *source* package ‘devtools’ ...
** libs
sh: make: command not found
ERROR: compilation failed for package ‘devtools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’

R CMD INSTALL error: Unexpected Symbol in test_load_package() function

Issue:
I'm just trying to build a few packages from source and am running into an error
Error: unexpected symbol in "tools:::.test_load_package('rbenchmark',
'\per-homedrive1.corp.something.org/homedrive$/Tommy.O'Dell"
Full output below:
C:\ROracle>R CMD INSTALL --build --merge-multiarch rbenchmark_1.0.0.tar.gz
install for i386
* installing to library '\\per-homedrive1.corp.something.org/homedrive$/Tommy.O'Dell/R/win-library/2.15'
* installing *source* package 'rbenchmark' ...
** package 'rbenchmark' successfully unpacked and MD5 sums checked
** R
** demo
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: unexpected symbol in "tools:::.test_load_package('rbenchmark', '\\per-homedrive1.corp.something.org/homedrive$/Tommy.O'Dell"
Execution halted
ERROR: loading failed
* removing '\\per-homedrive1.corp.something.org/homedrive$/Tommy.O'Dell/R/win-library/2.15/rbenchmark'
Question:
Is the error coming from the apostrophe (') from O'Dell in the path?
If yes, is it a bug since it isn't escaping the apostrophe in the directory?
Is it trying to install into my default library?
If yes, can I change the library as a parameter in R CMD INSTALL?
If I can't specify the library, should I remove that library altogether?
Extra Info:
Here's the output of .libPaths()
[1] "\\\\per-homedrive1.corp.something.org/homedrive$/Tommy.O'Dell/R/win-library/2.15"
[2] "C:/Program Files/R/R-2.15.2/library"
[3] "C:/Program Files/RStudio/R/library"
As I see it, the error comes from the apostrophe - R can't know that this doesn't end the path, but is part of it. Try it without it and it should work I guess. One solution might be also to use this kind of quotation instead " ", maybe this works out as well, because then the apostrophe doesn't end it any more...
EDIT: In order to install a package foo via command line to an specific library folder via command line you can use
R CMD build foo
R CMD INSTALL -l /home/daniel/myPkg/ foo_1.0.tar.gz
This means in your case this should work:
R CMD INSTALL --build --merge-multiarch -l C:/Program Files/RStudio/R/library rbenchmark_1.0.0.tar.gz

Resources