How to install dependencies when using “R CMD INSTALL” to install R packages?

后端 未结 6 696
心在旅途
心在旅途 2020-12-15 15:44

I\'m developing my first R package (using R 2.13, Ubuntu 10.10). Let\'s call it foo and let\'s say that the code in the R/ directory begins with the line libra

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 16:42

    Actually, re-reading the R extensions guide, it doesn't say that R CMD INSTALL will get dependencies from CRAN. The install.packages() method from within R will do that, but at first glance I don't think R CMD INSTALL does.

    You can use install.packages to install from a .tar.gz, but you have to set repos=NULL, and then this applies:

     dependencies: logical indicating to also install uninstalled packages
              on which these packages depend/suggest/import (and so on
              recursively).  Not used if repos = NULL.
    

    I suspect the thing to do is to get the dependencies out of the DESCRIPTION file and then run R and do an install.packages() on those when you are testing your build in a clean environment.

提交回复
热议问题