Examples for 'base::bquote'


Partial substitution in expressions

Aliases: bquote

Keywords: programming data

### ** Examples

require(graphics)

a <- 2

bquote(a == a)
a == a
quote(a == a)
a == a
bquote(a == .(a))
a == 2
substitute(a == A, list(A = a))
a == 2
plot(1:10, a*(1:10), main = bquote(a == .(a)))
plot of chunk example-base-bquote-1
## to set a function default arg
default <- 1
bquote( function(x, y = .(default)) x+y )
function(x, y = 1) x + y
exprs <- expression(x <- 1, y <- 2, x + y)
bquote(function() {..(exprs)}, splice = TRUE)
function() {
    x <- 1
    y <- 2
    x + y
}

[Package base version 4.2.3 Index]