query                 package:memisc                 R Documentation

_Q_u_e_r_y _a_n _O_b_j_e_c_t _f_o_r _I_n_f_o_r_m_a_t_i_o_n

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

     The function 'query' can be used to search an object for a
     keyword.

     The 'data.set' and 'importer' methods perform such a search
     through the annotations and value labels of the items in the data
     set.

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

     query(x,pattern,...)
     ## S4 method for signature 'data.set':
     query(x,pattern,...)
     ## S4 method for signature 'importer':
     query(x,pattern,...)

     ## S4 method for signature 'item':
     query(x,pattern,...)
     # (Called by the methods above.)

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

       x: an object

 pattern: a character string that gives the pattern to be searched for

     ...: optional arguments such as

          '_f_u_z_z_y' logical, TRUE by default; use fuzzy search via
               'agrep' or regexp search via 'grep' 

          '_e_x_t_e_n_d_e_d' logical, defaults to FALSE; passed to 'grep' 

          '_p_e_r_l' logical, defaults to TRUE; passed to 'grep' 

          '_f_i_x_e_d' logical, defaults to TRUE; passed to 'grep' 

          '_i_g_n_o_r_e._c_a_s_e' logical, defaults to TRUE; passed to 'grep' or
               'agrep'

          '_i_n_s_e_r_t_i_o_n_s' numerical value, defaults to 0.999999999; passed
               to 'agrep' 

          '_d_e_l_e_t_i_o_n_s' numerical value, defaults to 0; passed to 'agrep' 

          '_s_u_b_s_t_i_t_u_t_i_o_n_s' numerical value, defaults to 0; passed to
               'agrep' 

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

     If both the annotation and the value labels of an item match the
     pattern the 'query' method for 'item' objects returns a list
     containing the annotation and the value labels, otherwise if only
     the annotation or the value labels match the pattern, either the
     annotation or the value labels are returned, otherwise if neither
     matches the pattern, 'query' returns 'NULL'.

     The methods of 'query' for 'data.set' and 'importer' objects
     return a list of all non-'NULL' query results of all items
     contained by these objects, or 'NULL'.

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

     nes1948.por <- UnZip("anes/NES1948.ZIP","NES1948.POR",
                          package="memisc")
     nes1948 <- spss.portable.file(nes1948.por)
     query(nes1948,"TRUMAN")

