bquote
Partial substitution in expressionsAn analogue of the LISP backquote macro. bquote
quotes its argument except that terms wrapped in .()
are evaluated in the specified where
environment. If splice = TRUE
then terms wrapped in ..()
are evaluated and spliced into a call.
bquote(expr, where = parent.frame(), splice = FALSE)
expr | |
where | An environment. |
splice | Logical; if |
require(graphics) a <- 2 bquote(a == a) quote(a == a) bquote(a == .(a)) substitute(a == A, list(A = a)) plot(1:10, a*(1:10), main = bquote(a == .(a))) ## to set a function default arg default <- 1 bquote( function(x, y = .(default)) x+y ) exprs <- expression(x <- 1, y <- 2, x + y) bquote(function() {..(exprs)}, splice = TRUE)
Copyright (©) 1999–2012 R Foundation for Statistical Computing.
Licensed under the GNU General Public License.