require: Load/Attach Package to Local Search Path

Description Usage Arguments Value See Also Examples

View source: R/declaratives.R

Description

Can only be used in a module expression. Emulates the effect of base::require() in its containing module, making functions and their chain of environment available. Will not automatically attach dependencies of the package, and the user must do it separately. Masks base::require() inside a module context. Unlike base::require(), gives an error when package is not installed.

Usage

1
require(package)

Arguments

package

name of the package; name or character

Value

NULL; invisible

See Also

Other declaratives: name, provide, refer

Examples

1
2
3
4
5
6
7
mod_tcl <- mod::ule({
    mod:::require(tcltk)
    # It is suggested to omit mod::: when using
    f <- tcl
})

identical(mod_tcl$f, tcltk::tcl)

iqis/ntr documentation built on Dec. 7, 2019, 10:20 p.m.