4

I'm creating some internal packages with R in RStudio. My repositories are hosted in Azure DevOps. I saw the renv.lock and there is a section for repositories.

{
  "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

https://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?

Jeff
  • 265
  • 1
  • 4
Enrico
  • 3,592
  • 6
  • 45
  • 102
  • This is not currently supported. You can also file a feature request at https://github.com/rstudio/renv/issues. – Kevin Ushey Oct 30 '20 at 17:29
  • If my reply helped or gave a right direction. Appreciate for [marking it as an answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) which will also help others in the community. Thank you. – Kevin Lu-MSFT Nov 02 '20 at 08:13

2 Answers2

2

I got it to work using the remotes package!

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.

1

renv is able to install and restore packages from a variety of sources, including:

  • CRAN,
  • Bioconductor,
  • GitHub
  • Gitlab
  • Bitbucket

However, it does not include 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.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28