[Rd] Package Version Checking

Richard Barnes rbarnes at umn.edu
Tue Apr 18 22:26:31 CEST 2017


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]]



More information about the R-devel mailing list