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.

- 16,902
- 15
- 72
- 97
2 Answers
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.

- 16,902
- 15
- 72
- 97

- 146
- 2
-
I was trying this but it does not get dependencies. – Steven C. Howell Jun 20 '18 at 20:50
-
@StevenC.Howell, does adding `dependencies = TRUE` install them? – wibeasley Jun 20 '18 at 21:58
-
@StvenC.Howell, as @wibeasley says, set `dependencies=TRUE`, something like so: `install.packages("package_name", repos="url_to_the_repo_you_need", dependencies=TRUE)`. – Niels Berglund Jun 21 '18 at 03:09
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.

- 1,954
- 1
- 21
- 31

- 113
- 6