Package dependencies when installing from source in R

前端 未结 4 1419
梦毁少年i
梦毁少年i 2020-12-03 03:13

Just confirming: If I distribute my R package as ZIP/TAR then installing the package will not automatically download/install dependencies because I have to set repos =

相关标签:
4条回答
  • 2020-12-03 03:39

    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.

    0 讨论(0)
  • 2020-12-03 03:43

    You can use

      devtools::install_local(path)
    

    It can automatically download all the dependencies.

    0 讨论(0)
  • 2020-12-03 03:57

    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.

    0 讨论(0)
  • 2020-12-03 04:00

    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.

    0 讨论(0)
提交回复
热议问题