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

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



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.


Environment to assign.


Whether to supress the message.


Invisibly returns a list of assigned variables.


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