resolveMaps            package:AnnBuilder            R Documentation

_F_u_n_c_t_i_o_n_s _t_o _o_b_t_a_i_n _u_n_i_f_i_e_d _m_a_p_p_i_n_g_s _f_o_r _a _g_i_v_e_n _s_e_t _o_f _i_d_s _u_s_i_n_g
_v_a_r_i_o_u_s _s_o_u_r_c_e_s

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

     These functions are used to obtain unified mappings between two
     sets of ids based on the mappings available from different
     sources. Each source provide mappings between two sets of ids.

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

     resolveMaps(maps, trusted, srcs, colNames = NULL, outName = "", asFile = TRUE)
     getVote(voters, sep = ";")
     getUnified(voters)
     getNoDup(voters)
     hasDelimit(entry, deli = ";") 

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

    maps: 'maps' a matrix with mappings for a set of key ids to another
          set of ids provided by different sources. The first column is
          assumed to be the key ids and the rest are mappings to
          another set of ids provided by different sources

 trusted: 'trusted' a vector of characters to indicate the column
          number of "maps" whose mappings are more reliable and should
          be used when there are conflicts among sources

    srcs: 'srcs' a vector of character strings for the names of columns
          that contain mappings from different sources

colNames: 'colNames' a vector of character strings for the names of
          columns in "maps"

 outName: 'outName' a character string for the name of the file to
          contain the unified mappings

  asFile: 'asFile' a boolean to indicate whether the unified mappings
          will be saved as a file

  voters: 'voters' a vector containing mappings from different sources

   entry: 'entry' a character string to be checked for the existence of
          a separator

    deli: 'deli' a character string for a separator

     sep: 'sep' same as deli

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

     Each source may have different mappings from the key ids to
     another set of ids. 'resolveMaps' resolves the conflicts and
     derives a set of unified mappings based on the mappings provided
     from several sources.

     'getVote' resolves the mappings for a given key id and returns a
     vector with unified mapping and the number of sources that agree
     with the unified mapping.

     'getUnified' finds agreement among values in a vector passed. If
     some values agree, get the one agreed by most sources.

     'getNoDup' gets a value based on predefined rules when values from
     different sources do not agree.

     'hasDelimit' checks to see if a delimiter exists

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

     'resolveMaps' returns a matrix with the first column being the key
     id set, second being the unified mappings to another id set, and
     third the total number of agreements found among sources.

     'getVote' returns a two element vector.

     'getUnified' returns a character string.

     'getNoDup' returns a character string.

     'hasDelimit' returns TRUE or FALSE.

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

     Jianhua Zhang

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

     'LL-class', 'UG-class'

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

     ## Not run: 
     maps <- matrix(c("id1", "a", "a", "b", "id2", "c","d", "c",
     "id3", "e","e", "e", "id4", NA, "f", NA, "id5", "g", NA, "h", "id6", NA,
     "NA", "i", "id7", NA, NA, NA), ncol = 4, byrow = TRUE)
     unified <- resolveMaps(maps, c("srcll", "srcug"),
     c("srcll", "srcug", "srcgeo"),
     colNames = c("key1", "srcll", "srcug", "srcgeo"), outName = "",
     asFile = FALSE)
     ## End(Not run)

