1

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.

hkj447
  • 677
  • 7
  • 21

1 Answers1

1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250