Migrating from MRAN to Posit Package Manager
Following the announcement of the retirement of the Microsoft R Application Network (MRAN) at the end of June 2023, Posit has been working with Microsoft to preserve access to historic CRAN package snapshots. R users have relied on MRAN to make their projects easier to reproduce. Posit Package Manager supports many of the same workflows.
What is Posit Public Package Manager?
Posit Public Package Manager is a free service that provides complete mirrors of CRAN, Bioconductor, and PyPI, including historic package snapshots. We offer it to the data science community as part of our commitment to supporting reproducible research. It is based on Posit Package Manager, our professional product for teams who need greater control over how they expose R, Python, and Bioconductor packages within their organizations.
How does Package Manager differ from MRAN?
While MRAN contained daily snapshots of the entire CRAN website, Package Manager focuses on the packages contained within. Package Manager is fully CRAN-compliant, and packages can be installed via
MRAN provided CRAN-built binary packages for Windows and macOS, as well as source packages that must be built upon installation. Posit utilizes a secure, isolated build environment to make its own builds of binary packages for Windows on the current version of R as well as the past four R releases. Support for macOS binaries will be added very soon.
Posit also builds binary CRAN packages for nearly a dozen of the most popular Linux distributions, reducing the time and effort required to install those packages for R users on Linux. All of these are also available via Public Package Manager so you spend less time installing and more time working with your data.
NOTE: While we strive for comprehensive package coverage, there are some packages that may not yet have binary versions available, even for those that are available on CRAN.
Posit takes a snapshot of CRAN every business day. If a requested MRAN snapshot falls on a weekend or other date that does not have a corresponding snapshot available, Package Manager will serve packages from the previously available snapshot date. Snapshots are currently available beginning 2017-10-10. However, even for MRAN snapshots dates where there is a corresponding Package Manager snapshot, there is a small risk that the snapshots are not an exact match due to the exact time of day the synchronization with CRAN occurred.
Getting Started with Package Manager
If you currently set your
options("repos") directly in R, or through your
Rprofile.site files, to an MRAN snapshot URL, you can easily translate that URL to point to Posit Public Package Manager or a local Posit Package Manager server by simply changing the server name. For example:
r <- getOption("repos")
r["CRAN"] <- "https://packagemanager.posit.co/cran/latest/"
options(repos = r)
To install packages that were available from a specific snapshot date, replace “latest” with the date, for example:
r <- getOption("repos")
r["CRAN"] <- "https://packagemanager.posit.co/cran/2022-05-04/"
Using the checkpoint package
The checkpoint package, available on CRAN, is used to support package reproducibility in R using MRAN snapshots. For those who already use `checkpoint` as part of your work, Public Package Manager is now also compatible with the checkpoint package, and it can be used in place of MRAN by setting the
checkpoint.mranUrl option in R:
To persist the setting for all R sessions, add the setting to your
TIP: For new work that requires a reproducible environment, we recommend the renv package.
Try it for yourself
Whether you need a CRAN package from three years ago or just want the latest and greatest version available, we invite you to try Posit Public Package Manager for yourself today!
And for those who need more advanced control over your package repositories, including bringing CRAN inside your corporate firewall and adding your own internal packages to create a one-stop shop for all of your R and Python users, check out our professional Posit Package Manager.
How can I get more help?
Join the conversation on the Package Management topic on Posit Community.