violations          package:relations          R Documentation(utf8)

_V_i_o_l_a_t_i_o_n_s _o_f _R_e_l_a_t_i_o_n _P_r_o_p_e_r_t_i_e_s

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

     Computes a measure of remoteness of a relation from a specified
     property.

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

     relation_violations(x,
                         property =
                         c("complete", "match",
                           "reflexive", "irreflexive", "coreflexive",
                           "symmetric", "antisymmetric", "asymmetric",
                           "transitive", "negatively_transitive", "Ferrers",
                           "semitransitive",
                           "trichotomous",
                           "Euclidean"),
                         tuples = FALSE)

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

       x: an endorelation.

property: a character string specifying one of the properties for which
          the number of violations can be computed.

  tuples: a logical indicating whether to return the amount of
          violations (default), or the tuples for which the property is
          violated.

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

     If 'tuples' is false (default), the amount of violations for the
     specified property: for crisp relations, the minimum number of
     object tuples involved in the definition of the property (e.g.,
     singletons for reflexivity, pairs for antisymmetry, and triples
     for transitivity) that must be modified/added/removed to make the
     relation satisfy the property.

     If 'tuples' is true, a set of tuples of objects for which the
     respective property is violated.

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

     predicates for the definitions of the properties.

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

     ## partial order:
     R <- as.relation(1:3)
     relation_incidence(R)
     ## R clearly is transitive, but not symmetric:
     relation_violations(R, "transitive")
     relation_violations(R, "symmetric")
     ## Pairs for which symmetry is violated:
     relation_violations(R, "symmetric", TRUE)

     ## create a simple relation:
     R <- relation(domain = letters[1:2],
                   graph = set(pair("a","b"), pair("b","a")))
     relation_incidence(R)
     ## R is clearly symmetric, but not antisymmetric:
     relation_violations(R, "symmetric")
     relation_violations(R, "antisymmetric")

