%as% infix operator defines an alias to a package. In order to define aliases for multiple packages at once, use importas().

pkg %as% nm

importas(...)

Arguments

pkg

A name of package

nm

An abbreviated name of the package

...

Named arguments whose name is an alias to the value, i.e. package.

Value

NULL

Examples

graphics %as% gr gr$plot
#> function (x, y, ...) #> UseMethod("plot") #> <bytecode: 0x55a53023ecf8> #> <environment: namespace:base>
importas(gr = graphics, st = stats) gr$plot
#> function (x, y, ...) #> UseMethod("plot") #> <bytecode: 0x55a53023ecf8> #> <environment: namespace:base>
st$median
#> function (x, na.rm = FALSE, ...) #> UseMethod("median") #> <bytecode: 0x55a52ba377d8> #> <environment: namespace:stats>