Package Manager & Connect

How can we configure RStudio Connect with Package Manager?

For example I have a package manager which have repositories like 'A' for cran and 'B' for internal packages. How to configure connect so that whenever user deploy or publish application on connect, it fetches packages from the repositories A and B; instead of searching cran by itself.

RStudio Connect does not need to be configured for that. This is explained in the part about private repositories

RStudio Connect supports private repositories in these situations given that the deploying instance of R is correctly configured. No adjustment to the RStudio Connect server is needed.

Repository information is configured using the repos R option. Your users will need to make sure their desktop R is configured to use your corporate repository.

What happens is:

  • Your deployment is prepared through rsconnect :package: that will look for dependencies collecting there version and also the repo they were install from
  • This happens by looking at the current repositories configured on the system from where the deployment happens.
  • All those information are then sent to Connect that will try to recreate the environment by fetching missing packages and version from the repo that the deployments tells to look into. This is all due to packrat mechanism internally.

As explained in the doc linked above you can configure you repos in an option to put in .Rprofile. With you scenario, this would be something like

  r <- getOption("repos")
  r["A"] <- ""
  r["B"] <- ""
  options(repos = r)

You would then need to make sure the package you have installed locally are installed from thoses repositories. I don't know if it is a prerequisite but it is surely better.

Also, You RStudio connect serveur MUST have acces to your Package Manager on the network.


To summarize @cderv 's excellent response, all the configuration is done on the client not on Connect.