formulas                package:lme4                R Documentation

_U_t_i_l_i_t_i_e_s _f_o_r _f_o_r_m_u_l_a_s

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

     These generic functions extract sub-formulas or values of
     components from a formula/data pair.

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

     getCovariate(object, form, data)
     getCovariateFormula(object)
     getGroups(object, form, level, data, sep)
     getGroupsFormula(object, asList, sep)
     getResponse(object, form)
     getResponseFormula(object)
     subFormula(form, pos)
     splitFormula(form, sep)

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

  object: a formula or an object that can provide a formula

    form: an optional formula with a conditioning expression on its
          right hand side (i.e. an expression involving the `|'
          operator). Defaults to `formula(object)'.

   level: a positive integer vector with the level(s) of grouping to be
          used when multiple nested levels of grouping are present.
          This argument is optional for most methods of this generic
          function and defaults to all levels of nesting.

    data: a data frame in which to interpret the variables named in
          `form'. Optional for most methods.

  asList: an optional logical value. If `TRUE' the returned value with
          be a list of formulas; else, if `FALSE' the returned value
          will be a one-sided formula. Defaults to `FALSE'.

     sep: character, the separator to use between group levels when
          multiple levels are collapsed.  Defaults to `'/''.

     pos: the integer index of the component of the formula to return. 
          Defaults to `2'.

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

     `getGroupsFormula' returns a one-sided formula, or a list of
     one-sided formulas, giving the grouping structure associated with
     `formula(object)'. If no conditioning expression is present in
     `formula(object)' a `NULL' value is returned.

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

     form = resp ~ cov1 + cov2 | grp1/grp2
     getResponseFormula(form)
     getCovariateFormula(form)
     getGroupsFormula(form)
     getGroupsFormula(form, asList = TRUE)

