简体   繁体   English

RStudio 从 Azure DevOps 安装包

[英]RStudio install packages from Azure DevOps

I'm creating some internal packages with R in RStudio. My repositories are hosted in Azure DevOps.我正在 RStudio 中使用 R 创建一些内部包。我的存储库托管在 Azure DevOps 中。 I saw the renv.lock and there is a section for repositories.我看到了renv.lock并且有一个存储库部分。

{
  "R": {
    "Version": "3.6.1",
    "Repositories": [
      {
        "Name": "CRAN",
        "URL": "https://cran.rstudio.com"
      }
    ]
  },
  "Packages": {
    "BH": {
      "Package": "BH",
      "Version": "1.69.0-1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "0fde015f5153e51df44981da0767f522"
    },
    "KernSmooth": {
      "Package": "KernSmooth",
      "Version": "2.23-16",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "a531dc333440009ee13bbb507232476d"
    }
}

My components are in a url like我的组件在 url 之类的

https://dev.azure.com/mycompany/RComponents/_git/mycomponenthttps://dev.azure.com/mycompany/RComponents/_git/mycomponent

Is there a way to add my private repositories in here?有没有办法在这里添加我的私人存储库? How can I install R packages from Azure DevOps?如何从 Azure DevOps 安装 R 包?

renv is able to install and restore packages from a variety of sources, including: renv 能够从各种来源安装和恢复包,包括:

  • CRAN,起重机,
  • Bioconductor,生物导体,
  • GitHub GitHub
  • Gitlab Gitlab
  • Bitbucket Bitbucket

However, it does not include Azure DevOps.但是,它不包括 Azure DevOps。 Please refer to this document .请参考这份文件 In addition, there is also no information about using Azure DevOps repositories or packages in the RStudio Documentation .此外,在RStudio Documentation中也没有关于使用 Azure DevOps 存储库或包的信息。

I got it to work using the remotes package!我使用 remotes 包让它工作!

remotes::install_git("<clone url>", git = "external")

#AKA
remotes::install_git("https://ORG@dev.azure.com/USER/PROJECT/_git/NAME", git = "external")

You are then directed to a sign in handled via RStudio popups.然后,您将被引导至通过 RStudio 弹出窗口处理的登录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM