This is merely a convenience function which signals to a reader that shorthand (python-esque) namespacing is occurring. This is equivalent to
d <- "dplyr"
but demonstrates that this is to be explicitly used in a shorthand namespace
prefixing operation, such as d::select()
importAs(pkg = NULL, as = NULL) pkg %importAs% as
pkg | (character or symbol) name of a (hopefully installed) package |
---|---|
as | (character or symbol) symbol into which the package name should be assigned |
the symbol represented by as
is assigned the character string pkg
To turn on debug mode, in which a message is printed whenever
shorthand namespacing is in effect, set the option
options(importAs.debug = TRUE)
importAs("dplyr", "d")#>dplyr %importAs% d#>