From rbarnes at umn.edu  Tue Apr 18 22:26:31 2017
From: rbarnes at umn.edu (Richard Barnes)
Date: Tue, 18 Apr 2017 13:26:31 -0700
Subject: [Rd] Package Version Checking
Message-ID: <faaba057-ac73-a7d3-ec07-fd41494bc86f@umn.edu>

This is a feature suggestion.

My apologies if it's already been raised.

I recently noticed that dplyr's behaviour has changed:
> *dplyr 0.4.0*
> df <- data_frame(x = c(1, 1, 1, 2, 2), y = 1:5)
> result <- df %>% dplyr::distinct(x) %>% sum
> *# result == 8*
>
> *dplyr 0.5.0*
> df <- data_frame(x = c(1, 1, 1, 2, 2), y = 1:5)
> result <- df %>% dplyr::distinct(x) %>% sum
> *# result == 3*
That's fine. It's nice to see package maintainers fixing bugs and
improving functionality.

What's not fine is that for most users, myself included, this change was
essentially silent.

I would suggest amending the `library` and `require` functions as
follows, e.g.:
> library(dplyr, version='0.4.0', versioning='semantic')
> library(dplyr, version='0.4.0', versioning='exact')
If the version check indicates the package has been updated in a way
which doesn't maintain backwards compatibility, a warning message would
be generated or, possibly, the code would halt.

This would provide R users a way of specifying the conditions under
which their scripts produced the results they obtain.

Best regards,
Richard

	[[alternative HTML version deleted]]



[Rd] Package Version Checking
Richard Barnes