The R Project SVN R

Rev

Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 77266
Line 7... Line 7...
7
\alias{bquote}
7
\alias{bquote}
8
\title{Partial substitution in expressions}
8
\title{Partial substitution in expressions}
9
\description{
9
\description{
10
  An analogue of the LISP backquote macro.  \code{bquote} quotes its
10
  An analogue of the LISP backquote macro.  \code{bquote} quotes its
11
  argument except that terms wrapped in \code{.()} are evaluated in the
11
  argument except that terms wrapped in \code{.()} are evaluated in the
12
  specified \code{where} environment.
12
  specified \code{where} environment. If \code{splice = TRUE} then
-
 
13
  terms wrapped in \code{..()} are evaluated and spliced into a call.
13
}
14
}
14
\usage{
15
\usage{
15
bquote(expr, where = parent.frame())
16
bquote(expr, where = parent.frame(), splice = FALSE)
16
}
17
}
17
\arguments{
18
\arguments{
18
  \item{expr}{A \link{language object}.}
19
  \item{expr}{A \link{language object}.}
19
  \item{where}{An environment.}
20
  \item{where}{An environment.}
-
 
21
  \item{splice}{Logical; if \code{TRUE} splicing is enabled.}
20
}
22
}
21
 
23
 
22
\value{
24
\value{
23
  A \link{language object}.
25
  A \link{language object}.
24
}
26
}
Line 39... Line 41...
39
plot(1:10, a*(1:10), main = bquote(a == .(a)))
41
plot(1:10, a*(1:10), main = bquote(a == .(a)))
40
 
42
 
41
## to set a function default arg
43
## to set a function default arg
42
default <- 1
44
default <- 1
43
bquote( function(x, y = .(default)) x+y )
45
bquote( function(x, y = .(default)) x+y )
-
 
46
 
-
 
47
exprs <- expression(x <- 1, y <- 2, x + y)
-
 
48
bquote(function() {..(exprs)}, splice = TRUE)
44
}
49
}
-
 
50
 
45
\keyword{programming}
51
\keyword{programming}
46
\keyword{data}
52
\keyword{data}