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

后端 未结 6 680
心在旅途
心在旅途 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条回答
  •  Happy的楠姐
    2020-12-15 16:20

    The mechanism to do this is to add an entry in the depends field in your DESCRIPTION file.

    Depends: bar
    

    This will load the bar library if already installed, otherwise will install it from CRAN.

    This is described in section 1.1.1 of the Writing R extensions manual: http://cran.r-project.org/doc/manuals/R-exts.html#The-DESCRIPTION-file

提交回复
热议问题