home *** CD-ROM | disk | FTP | other *** search
-
- _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?
-
- missing(x)
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- missing can be used to test whether a value was speci-
- fied as an argument to a function. The following exam-
- ple shows how a plotting function can be written to
- work with either a pair of vectors giving x and y coor-
- dinates of points to be plotted or a single vector giv-
- ing y values to be plotted against their indexes.
-
- _E_x_a_m_p_l_e_s:
-
- myplot <- function(x,y) {
- if(missing(y)) {
- y <- x
- x <- 1:length(y)
- }
- plot(x,y)
- }
-
-