missing                 package:base                 R Documentation

_D_o_e_s _a _F_o_r_m_a_l _A_r_g_u_m_e_n_t _h_a_v_e _a _V_a_l_u_e?

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

     `missing' can be used to test whether a value was specified as an
     argument to a function. The following example shows how a plotting
     function can be written to work with either a pair of vectors
     giving x and y coordinates of points to be plotted or a single
     vector giving y values to be plotted against their indexes.

_U_s_a_g_e:

     missing(x)

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

     `substitute' for argument expression; `NA' for ``missing values''
     in data.

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

     myplot <- function(x,y) {
                     if(missing(y)) {
                             y <- x
                             x <- 1:length(y)
                     }
                     plot(x,y)
             }

