Closed ashander closed 7 years ago
First attempt at this is included in latest push; the following are valid (spaces are irrelevant in the specification):
import::from("magrittr(>= 1.5)", "%>%")
import::from("magrittr (>=1.5)", "%>%")
import::from("magrittr(== 1.5)", "%>%")
import::from("magrittr(1.5)", "%>%") # same as (==1.5)
import::from("magrittr(!= 1.0.1)", "%>%")
import::from(magrittr, "%>%") # no version, quotes are unnecessary.
As mentioned on twitter by @noamross specifying a version for a package function could improve script reproducibility.
Looking at your source for
import::from
, https://github.com/smbache/import/blame/master/R/from.R#L108 implementing seems straightforward using theversionCheck
argument ofloadNamespace
(which I've only just discovered).PS: a brief look on Google indicates actually using versionCheck may be a bit tricky. See this thread: http://r.789695.n4.nabble.com/Problem-understanding-behaviour-of-versionCheck-for-loadNamespace-and-when-versions-for-Imports-pack-td4700099.html