简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM