Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

CRAN (R)

view on GitHub

The Comprehensive R Archive Network (CRAN) is the main repository for packages written for the R language. Since version 2023.23, ProGet supports CRAN feeds to host R packages.

Installing Packages

R packages are installed using the install.packages method. To install a package from a ProGet feed, use the following command:

install.packages("«package-name»", repos="http://«proget-server»/cran/«feed-name»/")

Installing Specific Versions

The install.packages method can only install the latest version of a package. If you need to install a previous version, the easiest way is to download the package first and install from the file.

You can also use the install_version function from the remotes library.

Authenticating to Cran Feeds

If you've configured your feed to require authentication, you must pass a username and password in using the url:

install.packages("«package-name»", repos="https://«username»:«password»@«proget-server»/cran/«feed-name»/")

You can also create an API Key, entering api as the username and the API key as the password.

When creating an API Key, fill in the fields by selecting "Feeds ("Use Certain Feeds)" as the "Feed Type" and selecting the Conda feed to authenticate to. Make sure that the required permission boxes are checked, and then select "Save".

Next, add the feed to your local R environment. For this you will need to enter your API key, in addition to the URL.

For example, authenticating to http://proget.corp.local/cran/public-cran/ using the API key abc12345 you would enter:

install.packages("devtools", repos="http://api:abc12345@proget.corp.local/cran/public-cran/")

or add it as your RPM feed as a custom repository by entering:

options(repos = c(ProGet = "http://api:abc12345@proget.corp.local/cran/public-cran/"))

Confirm that it was set by entering:

getOption("repos")

You can also configure this in RStudio by navigating to "Tools" > "Global Options" > "Packages" and selecting "Change" and then entering the feed URL in the "Custom" field.

Creating and Publishing Packages

To learn how to create and publish an R package that can be hosted by ProGet, can read our HOWTO: Create and Upload CRAN Packages to a Private Repository in ProGet guide.

Connecting to External Repositories

You can create a connector to any CRAN-like repository such as https://cran.r-project.org/. This will allow you to proxy the external feed through ProGet, including any binary packages, but browsing through the web application is limited, since CRAN repositories typically only expose the latest version of each package with very little accompanying metadata.

Technical Limitations

Binary Packages

ProGet can store binary packages, but currently, the only way to add them to your feed is by caching them through a connector. Binary packages are typically built by CRAN rather than by package authors directly, so ProGet doesn't support directly uploading them. Let us know if you'd like this capability and we will consider adding it to a future version.