3

How do I install a specific package version in Microsoft R Open (MRO)? I am familiar with the checkpoint("YYYY-MM-DD") function for changing ALL package versions to a specific MRO snapshot. I do not want to do this. I only want to change the version of a single package.

Steven C. Howell
  • 16,902
  • 15
  • 72
  • 97

2 Answers2

4

To install a specific version of a package, download the package from the CRAN or MRAN archive (src/contrib/Archive) and install it with

install.packages("/path/to/pkg/src", type="source")

where/path/to/pkg/src is the path to the downloaded package.

To get the package directly from a specific MRAN snapshot, use

install.packages('pkg', repos='https://mran.microsoft.com/snapshot/YYYY-MM-DD/')

To also get the dependencies, you want

install.packages('pkg', repos='https://mran.microsoft.com/snapshot/YYYY-MM-DD/', dependencies=TRUE)

Be aware, however, that the version you choose may not be compatible with the version of MRO you are using. This is why MRO uses a specific MRAN snapshot--to ensure compatibility of available packages with the specific MRO.

Steven C. Howell
  • 16,902
  • 15
  • 72
  • 97
Rich Calaway
  • 146
  • 2
0

I'm not too familiar with the checkpoint() function but what I do see is that you can set project to a directory of packages you want to project be installed from the MRAN snapshot for the date specified for snapshotDate. It defaults to current working directory using getwd(), so I would assume if you changed the directory and had a specific package there, you would be able to workaround that way.

dpel
  • 1,954
  • 1
  • 21
  • 31