如何在r takexte`description'的“远程”字段中包含子目录。

发布于 2025-02-08 18:39:30 字数 604 浏览 2 评论 0 原文

假设我想在我的r软件包中使用依赖性的开发版本,因为它位于某个github分支上,但另一个并发症是它位于 subdirectory 中。

例如,如果我想依靠远程喜欢下载它:

remotes::install_github("glmmTMB/glmmTMB@ci_tweaks", subdir = "glmmTMB")

如果此软件包是不是基于子目录的,我可以将以下内容包括在 Description> Description 文件中:

Remotes: glmmTMB/glmmTMB@ci_tweaks

但是我不知道如何在此处指定子目录以获取软件包。

Let's say I want to use in my R package a development version of a dependency as it stands on a certain GitHub branch, but the additional complication is that it resides in a subdirectory.

For example, if I wanted to rely on the glmmTMB package from this branch, I can download it using remotes like so:

remotes::install_github("glmmTMB/glmmTMB@ci_tweaks", subdir = "glmmTMB")

If this package were not based in a subdirectory, I could have included the following in the DESCRIPTION file:

Remotes: glmmTMB/glmmTMB@ci_tweaks

But I don't know how to specify a subdirectory here to get the package.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

阿楠 2025-02-15 18:39:30

您应该知道,遥控器为您创建所有需要的描述文件字段。因此,我运行远程:: install_github(“ glmmtmb/glmmtmb@ci_tweaks”,subdir =“ glmmtmb”),然后 packagedEscription(“ glmmtmb”) 。查看添加了多少个远程和GITHUB连接的备案。例如远程图:glmmtmb 也有。

> 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 = "[email protected]"), 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 <[email protected]>
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

You should know that remotes creates all needed DESCRIPTION file fields for you. So I run the remotes::install_github("glmmTMB/glmmTMB@ci_tweaks", subdir = "glmmTMB") and then packageDescription("glmmTMB"). Check out how many Remote and Github connected fileds are added. There is e.g. RemoteSubdir: glmmTMB too.

> 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 = "[email protected]"), 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 <[email protected]>
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
情未る 2025-02-15 18:39:30

Entries in Remotes that are intended to install from GitHub can take the following

[<package>=][github::]<username>/<repository>[/<subdir>][<detail>]

对于此示例,远程字段中的条目应为 glmmtmb = github :: glmmtmb/glmmtmb/glmmtmb/glmmtmb/glmmtmb/glmmtmb@ci_tweaks@ci_tweaks@ci_tweaks@ci_tweaks glmmtmb 应出现在依赖> 中(或在类似的字段中,例如建议)。

Entries in Remotes that are intended to install from GitHub can take the following general form:

[<package>=][github::]<username>/<repository>[/<subdir>][<detail>]

For this example the entry in the Remotes field should be glmmTMB=github::glmmTMB/glmmTMB/glmmTMB@ci_tweaks, and glmmTMB should appear in Depends (or in a similar field like Suggests).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文