首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在R包“`DESCRIPTION`”的“`Remotes`”字段中包括子目录

如何在R包“`DESCRIPTION`”的“`Remotes`”字段中包括子目录
EN

Stack Overflow用户
提问于 2022-06-18 19:06:15
回答 1查看 42关注 0票数 0

假设我想在我的R包中使用一个依赖关系的开发版本,因为它位于某个GitHub分支上,但更复杂的是它驻留在一个子目录中。

例如,如果我想依赖来自这个分支的glmmTMB包,我可以使用remotes下载它,如下所示:

代码语言:javascript
复制
remotes::install_github("glmmTMB/glmmTMB@ci_tweaks", subdir = "glmmTMB")

如果这个包是基于子目录的而不是,我可以在DESCRIPTION文件中包含以下内容:

代码语言:javascript
复制
Remotes: glmmTMB/glmmTMB@ci_tweaks

但是我不知道如何在这里指定一个子目录来获取包。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-18 19:37:18

您应该知道remotes为您创建了所有需要的描述文件字段。所以我运行remotes::install_github("glmmTMB/glmmTMB@ci_tweaks", subdir = "glmmTMB"),然后运行packageDescription("glmmTMB")。请查看添加了多少远程文件和Github连接文件。例如,也有RemoteSubdir: glmmTMB

代码语言:javascript
复制
> packageDescription("glmmTMB")
Package: glmmTMB
Title: Generalized Linear Mixed Models using Template Model Builder
Version: 1.1.4
Authors@R: c(person("Mollie","Brooks", comment=c(ORCID="0000-0001-6963-8326"), role =
          c("aut", "cre"), email = "mollieebrooks@gmail.com"), person("Ben","Bolker",
          role="aut", comment=c(ORCID="0000-0002-2127-0443")),
          person("Kasper","Kristensen",role="aut"), person("Martin","Maechler", role="aut",
          comment=c(ORCID="0000-0002-8685-9910")), person("Arni","Magnusson", role="aut",
          comment=c(ORCID="0000-0003-2769-6741")), person("Maeve","McGillycuddy",
          role="ctb"), person("Hans","Skaug",role="aut"), person("Anders","Nielsen",
          role="aut", comment=c(ORCID="0000-0001-9683-9262")), person("Casper","Berg",
          role="aut", comment=c(ORCID="0000-0002-3812-5269")), person("Koen","van Bentham",
          role="aut"), person("Nafis","Sadat",role="ctb",
          comment=c(ORCID="0000-0001-5715-616X")), person("Daniel","Lüdecke", role="ctb",
          comment=c(ORCID="0000-0002-8895-3206")), person("Russ","Lenth", role="ctb"),
          person("Joseph", "O'Brien", role = "ctb", comment = c(ORCID =
          "0000-0001-9851-5077")), person("Charles J.","Geyer", role="ctb"),
          person("Mikael","Jagan", role="ctb", comment = c(ORCID = "0000-0002-3542-2938")),
          person("Brenton", "Wiernik", role="ctb", comment = c(ORCID =
          "0000-0001-9560-6336")) )
Description: Fit linear and generalized linear mixed models with various extensions,
          including zero-inflation. The models are fitted using maximum likelihood
          estimation via 'TMB' (Template Model Builder). Random effects are assumed to be
          Gaussian on the scale of the linear predictor and are integrated out using the
          Laplace approximation. Gradients are calculated using automatic differentiation.
License: AGPL-3
Depends: R (>= 3.2.0)
Imports: methods, TMB (>= 1.7.14), lme4 (>= 1.1-18.9000), Matrix, nlme, numDeriv
LinkingTo: TMB, RcppEigen
Suggests: knitr, rmarkdown, testthat, MASS, lattice, ggplot2 (>= 2.2.1), mlmRev, bbmle (>=
          1.0.19), pscl, coda, reshape2, car (>= 3.0.6), emmeans (>= 1.4), estimability,
          DHARMa, multcomp, MuMIn, effects (>= 4.0-1), dotwhisker, broom, broom.mixed, plyr,
          png, boot, texreg, xtable, huxtable, mvabund
SystemRequirements: GNU make
VignetteBuilder: knitr, rmarkdown
URL: https://github.com/glmmTMB/glmmTMB
LazyData: TRUE
BugReports: https://github.com/glmmTMB/glmmTMB/issues
NeedsCompilation: yes
Encoding: UTF-8
RoxygenNote: 7.1.2
RemoteType: github
RemoteHost: api.github.com
RemoteRepo: glmmTMB
RemoteUsername: glmmTMB
RemoteRef: ci_tweaks
RemoteSha: fd8bb78acd8b198147285ce94b1f67043349f570
RemoteSubdir: glmmTMB
GithubRepo: glmmTMB
GithubUsername: glmmTMB
GithubRef: ci_tweaks
GithubSHA1: fd8bb78acd8b198147285ce94b1f67043349f570
GithubSubdir: glmmTMB
Packaged: 2022-06-18 19:33:52 UTC; maciejnasinski
Author: Mollie Brooks [aut, cre] (<https://orcid.org/0000-0001-6963-8326>), Ben Bolker [aut]
          (<https://orcid.org/0000-0002-2127-0443>), Kasper Kristensen [aut], Martin
          Maechler [aut] (<https://orcid.org/0000-0002-8685-9910>), Arni Magnusson [aut]
          (<https://orcid.org/0000-0003-2769-6741>), Maeve McGillycuddy [ctb], Hans Skaug
          [aut], Anders Nielsen [aut] (<https://orcid.org/0000-0001-9683-9262>), Casper Berg
          [aut] (<https://orcid.org/0000-0002-3812-5269>), Koen van Bentham [aut], Nafis
          Sadat [ctb] (<https://orcid.org/0000-0001-5715-616X>), Daniel Lüdecke [ctb]
          (<https://orcid.org/0000-0002-8895-3206>), Russ Lenth [ctb], Joseph O'Brien [ctb]
          (<https://orcid.org/0000-0001-9851-5077>), Charles J. Geyer [ctb], Mikael Jagan
          [ctb] (<https://orcid.org/0000-0002-3542-2938>), Brenton Wiernik [ctb]
          (<https://orcid.org/0000-0001-9560-6336>)
Maintainer: Mollie Brooks <mollieebrooks@gmail.com>
Built: R 4.2.0; aarch64-apple-darwin20; 2022-06-18 19:33:53 UTC; unix

-- File: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/glmmTMB/Meta/package.rds
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72671996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档