home *** CD-ROM | disk | FTP | other *** search
-
- _P_a_r_t_i_a_l _S_t_r_i_n_g _M_a_t_c_h_i_n_g
-
- pmatch(x, table, nomatch = NA)
- charmatch(x, table, nomatch = NA)
-
- _A_r_g_u_m_e_n_t_s:
-
- x : the values to be matched.
-
- table : the values to be matched against.
-
- nomatch : the value returned at non-matching positions.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- pmatch seeks matches for the elements of its first
- argument among those of its second. If there is a
- unique match then the index of the matching value is
- returned; if multiple matches are found then 0 is
- returned and if no match is found then NA is returned.
-
- This function is based on Terry Therneau's charmatch S
- function. In R, charmatch is synonym to pmatch.
-
- _S_e_e _A_l_s_o:
-
- match.
-
- _E_x_a_m_p_l_e_s:
-
- pmatch("m", c("mean", "median", "mode")) # returns 0
- pmatch("med", c("mean", "median", "mode")) # returns 2
-
-