pr <- as.PowerRelation("12 > 1 > 2")
# TRUE
d1 <- dominates(pr, 1, 2)
# FALSE
d2 <- dominates(pr, 2, 1)
# TRUE (because it's not strict dominance)
d3 <- dominates(pr, 1, 1)
# FALSE
d4 <- dominates(pr, 1, 1, strictly = TRUE)
stopifnot(all(d1, !d2, d3, !d4))
Run the code above in your browser using DataLab