Skip to content
Prev 1531 / 12125 Next

[R-pkg-devel] Depending on currently unreleased package

On 06/05/2017 4:02 PM, William Brannon wrote:
You can list dbplyr in Suggests, and put in conditionals to test for it. 
  If you don't want to wait for its release you'll need to have code 
that works without it as well, so something like this

if (requireNamespace("dbplyr"))
   foo <- dbplyr::foo
else if (packageVersion("dplyr") < "x.y.z")
   foo <- dplyr::foo
else
   stop("You need to install the dbplyr package, because dplyr::foo has 
moved there.")

will allow you to use foo() anywhere (as long as its interface is the 
same in both packages, of course).

Duncan Murdoch