# Preference on mtcars for high mpg and low weight
p <- high(mpg) * low(wt)
init_pred_succ(mtcars, p)
# Helper to show mpg/hp values
show_vals <- function(x) mtcars[x,c('mpg','wt')]
# Pick some tuple "in the middle"
show_vals(10)
# Show (direct) predecessors/successors
show_vals(hasse_pred(p, 10)) # Next better car
show_vals(hasse_succ(p, 10)) # Next worse car
show_vals(all_pred(p, 10)) # All better cars
show_vals(all_succ(p, 10)) # All worse carsRun the code above in your browser using DataLab