fuzzyMatches              package:HELP              R Documentation

_F_u_z_z_y _m_a_t_c_h_i_n_g

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

     Match and reinterpret a vector in terms of a second vector,
     essentially using the second vector as a key to interpret the
     first.

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

     fuzzyMatches(x, y, ...)

_A_r_g_u_m_e_n_t_s:

       x: vector, the values to be matched. 

       y: vector, the values to be matched against. 

     ...: Arguments to be passed to methods (see 'getSamples-methods'):

          '_s_t_r_i_c_t' logical indicating whether or not to allow restrict
               matching. If 'FALSE', numerical indices in 'x' can
               reference values in 'y'. If 'TRUE' (default), only exact
               matches of values in 'x' and 'y' will be used. 

          '_k_e_e_p' logical indicating whether or not to preserve
               non-matching values from 'x' (when 'strict = FALSE'). If
               'TRUE' (default), all values in 'x' will be returned
               with those that match values in 'y' replaced by the
               corresponding values in 'y'. If 'FALSE', non-matching
               values will be removed.  

          '_a_l_i_a_s' logical indicating whether or not to return aliased
               values (default is 'TRUE'). If 'FALSE', numerical
               indices will be returned with a value of 'nomatch' for
               non-matching values in 'x'. 

          '_m_a_t_c_h._a_l_l' character value, specifying a special value to be
               interpreted as a match for ALL values in 'y' (default is
               '"*"'). Any occurence of 'match.all' in 'x' will be
               replaced by all values in 'y'. 

          '_n_o_m_a_t_c_h' numerical, specifying a value for non-matching
               values in code{x} when 'strict = FALSE', 'keep = TRUE',
               and 'alias = FALSE'.

          '_n_a._r_m' a logical value indicating whether NA values should
               be stripped before the computation proceeds (default is
               'TRUE'). If 'FALSE' any missing values in 'x' will cause
               an error and missing values in code{y} may cause
               unexpected behavior. 

          '...' other arguments not handled at this time.  

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

     This function employs multiple stages of matching between two
     vectors.  First, the values in 'x' are matched against 'y' to find
     any exact matches. Next, numerical values in 'x' are used to
     retrieve the corresponding positions in 'y'. All unmatched values
     may be retained or dropped (depending on the value of 'keep'), and
     a list of unique values is returned. Note that a value of
     'match.all' in 'x' will be interpreted as a match for ALL values
     in 'y', and therefore replaced with the contents of 'y'.

_V_a_l_u_e:

     Returns a vector of unique values in 'x', that match values in 'y'
     according to the parameters described above.

_A_u_t_h_o_r(_s):

     Reid F. Thompson (rthompso@aecom.yu.edu)

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

     'fuzzyMatches-methods', 'match'

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

     a <- c(1, "four", "missing")
     b <- c("one", "two", "three", "four")
     fuzzyMatches(a, b)
     fuzzyMatches(a, b, strict=FALSE)
     fuzzyMatches(a, b, strict=FALSE, alias=FALSE)
     fuzzyMatches(a, b, strict=FALSE, keep=FALSE)

