ranking              package:relations              R Documentation

_R_a_n_k_i_n_g_s

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

     Creates a ranking object.

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

     ranking(x, domain = NULL, decreasing = TRUE, complete = FALSE)
     as.ranking(x, ...)
     is.ranking(x)

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

       x: For 'ranking': either an atomic vector interpreted as labels
          of the ranked objects, or a list of such vectors representing
          equivalence classes.  For 'as.ranking': an R object coercible
          to a ranking object (including 'relation' objects).

  domain: object coercible to a set, from which the labels usable in
          'x' are derived.  If 'NULL', it is created from 'x'.

decreasing: logical indicating whether the ranking orders objects from
          the best to the worst ('TRUE'), or the other way round.

complete: logical specifying whether missing values should be imputed,
          if any. Missing elements are those from 'domain' not used in
          'x'. If 'decreasing' is 'TRUE' ('FALSE'), all missings are
          ranked tied behind (ahead) the worst (best) ranked object.

     ...: currently not used.

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

     An object of class 'ranking'.

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

     'relation'

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

     ## simple rankings
     OBJECTS <- c("Apples", "Bananas", "Oranges", "Lemons")
     print(R <- ranking(OBJECTS))
     ranking(OBJECTS[2:4], domain = OBJECTS)
     ranking(OBJECTS[2:4], domain = OBJECTS, complete = TRUE)

     ## ranking with ties (weak orders)
     ranking(list(c("PhD", "MD"), "MSc", c("BSc", "BA")))

     ## coercion functions
     identical(as.ranking(as.relation(R)), R)

