

_A_c_t_u_a_l _A_r_g_u_m_e_n_t_s

     substitute(expr, env=NULL)
     quote(expr, env=NULL)

_D_e_s_c_r_i_p_t_i_o_n:

     `substitute' returns the expression which was typed as
     the value of a formal argument.  `quote' is a synonym
     useful to lisp programmers.

_D_e_t_a_i_l_s:

     The typical use of this is to create informative labels
     for data sets and plots.  The `myplot' example below
     shows a simple use of this facility.  It uses the func-
     tions `deparse' and `substitute' to create labels for a
     plot which are character string versions of the actual
     arguments to the function `myplot'.

_S_e_e _A_l_s_o:

     `missing' for argument ``missingness''.

_E_x_a_m_p_l_e_s:

     substitute(expression(a + b), list(a = 1))#> expression(1 + b)

     myplot <- function(x, y)
             plot(x, y, xlab=deparse(substitute(x)),
                     ylab=deparse(substitute(y)))

     ## Simple examples about lazy evaluation, etc:

     f1 <- function(x, y = x)             { x <- x + 1; y }
     s1 <- function(x, y = substitute(x)) { x <- x + 1; y }
     s2 <- function(x, y) { if(missing(y)) y <- substitute(x); x <- x + 1; y }
     a <- 10
     f1(a)# 11
     s1(a)# 11
     s2(a)# a
     typeof(s2(a))# "symbol"

