pr <- as.PowerRelation("12 > 1 > 2")
# `1`: c(1, 2, 2)
# `2`: c(1, 1, 2)
cumulativeScores(pr)
# calculate for selected number of elements
cumulativeScores(pr, c(2))
# TRUE
d1 <- cumulativelyDominates(pr, 1, 2)
# TRUE
d2 <- cumulativelyDominates(pr, 1, 1)
# FALSE
d3 <- cumulativelyDominates(pr, 1, 1, strictly = TRUE)
stopifnot(all(d1, d2, !d3))
Run the code above in your browser using DataLab