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

Martin Watts martinleewatts at gmail.com
Wed May 31 11:18:58 CEST 2017


Hi,

Thanks for your reply, I've taken a look at packrat and it looks
interesting but I don't think it's quite what I want. Packrat works on the
assumption that the R session is run from the project directory, which
won't necessarily be true in our case since, for example, we interface with
some of our R code from python and our packages reference each other.

Our deployment process at the moment is to just install.packages our
packages to get all the required dependencies. This work well so I'd like
to keep to this structure but I'm surprised that the DESCRIPTION file
supports the == syntax if there is no way to enforce it at install?

My alternative would be to write my own script that parses our DESCRIPTION
files, pulls out the required versions and uses some code like this (
https://gist.github.com/viking/1503736) to install the external packages
manually first before installing our packages, but this seems like it would
be a lot of work.

Thanks,
Martin

On Mon, May 22, 2017 at 8:52 AM, Facundo Muñoz <famuvie at gmail.com> wrote:

> I think Packrat [1] might help:
>
> - Isolated: ... each project its own private package library.
> - Reproducible: ... exact versions are the ones that get installed ...
>
> ƒacu.-
>
> [1] https://rstudio.github.io/packrat/
>
>
> On 05/18/2017 04:34 PM, 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.
> >
> > 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.
> >
> > Note that I've been testing using devtools::install, but I assume that
> this
> > mirrors the behaviour of install.packages.
> > 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
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list