bquote
Partial substitution in expressions
Description
An 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.
Usage
bquote(expr, where = parent.frame(), splice = FALSE)
Arguments
expr | |
where | An environment. |
splice | Logical; if |
Value
See Also
Examples
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.