get_hasse_diag | R Documentation |
Returns the adjacency list of the Hasse diagram of a preference as an (n x 2) matrix. This is the transitive reduction of the preference relation.
get_hasse_diag(df, pref)
df |
A data frame. |
pref |
A preference on the columns of |
A row (i, j) in the resulting matrix means that df[i,]
is better than df[j,]
with regard to the preference p
.
The matrix is the transitive reduction (Hasse diagram) of the induced relations,
i.e., if (1,2) and (2,3) occur in the result, then (1,3) will not be contained.
The number of rows in the result depends on the number of non-transitive Better-Than-Relationships in df
w.r.t. p
.
get_btg
to plot the Hasse diagram.
get_hasse_diag(mtcars, low(mpg))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.