Recode                 package:Rcmdr                 R Documentation

_R_c_m_d_r _R_e_c_o_d_e _D_i_a_l_o_g

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

     The recode dialog is normally used to recode numeric variables and
     factors into factors, for example by combining values of numeric
     variables or levels of factors. It may also be used to produce new
     numeric variables. The Rcmdr recode dialog is based on the
     'recode' function in the 'car' package.

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

     The name of the new variable must be a valid R object name
     (consisting only of upper and lower-case letters, numerals, and
     periods, and not starting with a numeral).

     Enter recode directives in the box at the right. Directives are
     normally entered one per line,  but may also be separated by
     semicolons. Each directive is of the form 'input = output'  (see
     the examples below). If an input value satisfies more than one
     specification, then the  first (from top to bottom, and left to
     right) applies. If no specification is satisfied, then  the input
     value is carried over to the result. 'NA' is allowed on input and
     output. Factor  levels are enclosed in double-quotes on both input
     and output.

     Several recode specifications are supported: 

     _a _s_i_n_g_l_e _v_a_l_u_e For example, '"missing" = NA'.

     _s_e_v_e_r_a_l _v_a_l_u_e_s _s_e_p_a_r_a_t_e_d _b_y _c_o_m_m_a_s For example, '7,8,9 = "high"'.

     _a _r_a_n_g_e _o_f _v_a_l_u_e_s _i_n_d_i_c_a_t_e_d _b_y _a _c_o_l_o_n For example, '7:9 =
          "high"'. The special values 'low' and 'high' may appear in a
          range. For example, 'low:10=1'. Note that these values are
          unquoted.

     _t_h_e _s_p_e_c_i_a_l _v_a_l_u_e '_e_l_s_e' everything that does not fit a previous
          specification. For example, 'else=NA'. Note that 'else'
          matches _all_     otherwise unspecified values on input,
          including 'NA'.

     If all of the output values are numeric, and the "Make new
     variable a factor" check box is  unchecked, then a numeric result
     is returned.

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

     John Fox jfox@mcmaster.ca

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

     'recode'

