This is a convenient way to initialize variables and assign them in the given environment.

use_vars(..., .env = parent.frame(), .quiet = FALSE)

Arguments

...

All the arguments will be quoted and parsed, if a argument is named, the name will be used as the name of variable to assign, otherwise the argument can only be a symbol.

.env

Environment to assign.

.quiet

Whether to supress the message.

Value

Invisibly returns a list of assigned variables.

Examples

use_vars(x, y, expr = "a + b", p = 3.14)
#> Initializing ‘x’, ‘y’, ‘expr’, ‘p’
p * x + y
#> (Add)	3.14*x + y
expand(expr^2L)
#> (Add)	2*a*b + a^2 + b^2
rm(x, y, expr, p)