[R-pkg-devel] R force download of specific package versions in DESCRIPTION file

Duncan Murdoch murdoch.duncan at gmail.com
Sun May 21 15:09:28 CEST 2017

On 18/05/2017 10:34 AM, Martin Watts wrote:
> I have created a package (which I host on a local server) that I have set
> up to depend on exact versions of other packages, i.e my DESCRIPTION file
> looks like this:
> Package: myPackage
> Depends:
>     R (>= 3.2.5)
> Imports:
>     dplyr (== 0.5.0),
>     lazyeval (== 0.2.0),
>     lubridate (== 1.6.0),
>     magrittr (== 1.5),
>     reshape2 (== 1.4.2)
> My expectation is that when I run install.packages('myPackage') that each
> of these specific dependency versions will be installed, but this is not
> the case. It looks like if a dependent package is not present at all then
> it is installed to the correct version, but when it is present at a LATER
> version it is not rolled-back to the desired version.

That could leave your library in an unusable state.  Suppose one package 
requires reshape2 1.4.2, and a later install requires reshape2 1.4.1. 
Then the second install shouldn't roll back the version of reshape2 or 
it would break the first package.

It's also wrong if it allows the second package to install with 1.4.2 in 
place; that sounds like a bug.

> Is there a way that we can force all requested versions of these packages
> to be installed? We would like this behaviour as we'd like a way to
> guarantee that all R environments are exactly the same when running this
> code.

Uninstall everything before installing the new one.

There are also a couple of efforts for reproducing exact environments. 
Can't think of the names right now.

> Note that I've been testing using devtools::install, but I assume that this
> mirrors the behaviour of install.packages.

You should test the code you're complaining about, not some other code. 
All we know from what you've reported is that devtools::install has a 
bug. We don't know that install.packages has the same bug.

Duncan Murdoch

> Also posted on SO: http://stackoverflow.com/questions/44028355/r-force-
> download-of-specific-package-versions-in-description-file
> Thanks,
> Martin
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

More information about the R-package-devel mailing list