poset {POSetR} | R Documentation |
Generates a Partially Ordered SET from the list of dominances
Description
Function poset
creates a poset from a dominance list. x
argument is a two-column matrix, each row defines a pair of comparable elements, where the element in the first column is dominated by or coincide with the element in the second column. If the elements of x
are numeric, they are first coerced to character and used as elements labels.
Usage
poset(x = NULL, elements = unique(as.character(x)))
Arguments
x |
an object of class |
elements |
a vector of characters listing all the labels of the elements. |
Details
A partial order relation is reflexive, transitive and anti-symmetric. Given the dominance list provided by the user, the function produces the smallest poset comprising them (reflexive and transitive closure); in case the dominances provided by the user imply non-trivial cicles, violating anti-simmetry, the function returns an error.
By default elements
is equal to all the different labels available in x
.
If some elements are incomparable, list all of the elements in elements
or include self-comparabilities in x
. Notice that antichains can be created in a simpler way, by function
antiChain
.
Value
an environment of class poset
; this class contains a pointer with different C++ methods used by other functions of the package.
See Also
in the package are available functions that simply the creation of particular posets: antiChain
to create a poset without comparabilities,
chain
to create a complete order,
poset_from_dataframe
to create a poset from a statistical population.
Examples
dom <- matrix(c(
"a", "b",
"c", "b",
"b", "d"
), ncol = 2, byrow = TRUE)
poset(x = dom)
poset(x = dom, elements = letters[1:5])