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

后端 未结 6 668
心在旅途
心在旅途 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条回答
  •  -上瘾入骨i
    2020-12-15 16:21

    Fortunately Devtools provides an easy solution: install_deps()

    install_deps(pkg = ".", dependencies = logical, threads = getOption("Ncpus",1))

    Arguments:
    pkg: package description, can be path or package name. See ‘as.package’ for more information

    dependencies: ‘logical’ indicating to also install uninstalled packages which this ‘pkg’ depends on/links to/suggests. See argument ‘dependencies’ of ‘install.packages’.

    threads: number of concurrent threads to use for installing dependencies. It defaults to the option ‘"Ncpus"’ or ‘1’ if unset.

    Examples:

    install_deps(".")  
    install_deps("/path/to/package",dependencies="logical")
    

提交回复
热议问题