Package dependencies when installing from source in R

為{幸葍}努か 提交于 2019-11-27 20:36:20

You could make your own repository and set repos to be a vector of the places to look for packages, where it would start with your own repository and then include a link to a CRAN mirror. This is what I do and it works quite nicely, as then I can easily share my packages with others and update them from whatever computer I happen to be on.

The devtools package has a function install. If used on a directory containing the source code for an R package, it will install that package and download any dependencies from CRAN.

You can use

  devtools::install_local(path)

It can automatically download all the dependencies.

If you have a Github account myname, push your R package to a repo mypackage. Then just call devtools::install_github("myname/mypackage"). Package mypackage will be downloaded and installed as will all the dependencies listed under Imports in the DESCRIPTION file.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!