Steven C. Howell
Steven C. Howell

Reputation: 18654

Install specific package version in Microsoft R Open

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.

Upvotes: 3

Views: 1286

Answers (2)

Albert Pariente-Cohen
Albert Pariente-Cohen

Reputation: 113

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.

Upvotes: 0

Rich Calaway
Rich Calaway

Reputation: 146

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.

Upvotes: 4

Related Questions