Closed moodymudskipper closed 4 years ago
bquote() is just like quote() except that it expands the content of .() by evaluating it in the chosen environment (parent by default).
bquote()
quote()
.()
[.tb works the same by expanding the content of .() before evaluating the arguments or labels (lhs of :=).
[.tb
:=
So we can do things like the following :
expr <- quote(Sepal.Length * Sepal.Width) nm <- quote(Sepal.Area) iris_tb[.(nm) := .(expr)]
This expansion is done by using expand_expr(), built around code from bquote, but not wrapping bquote directly, for efficiency, and to allow the content of .() to be evaluated through the mask.
expand_expr()
bquote
bquote()
is just likequote()
except that it expands the content of.()
by evaluating it in the chosen environment (parent by default).[.tb
works the same by expanding the content of.()
before evaluating the arguments or labels (lhs of:=
).So we can do things like the following :
This expansion is done by using
expand_expr()
, built around code frombquote
, but not wrapping bquote directly, for efficiency, and to allow the content of.()
to be evaluated through the mask.