# Skyline and Top-K/At-least skyline
psel(mtcars, low(mpg) * low(hp))
psel(mtcars, low(mpg) * low(hp), top = 5)
psel(mtcars, low(mpg) * low(hp), at_least = 5)
# Visualize the skyline in a plot
sky1 <- psel(mtcars, high(mpg) * high(hp))
plot(mtcars$mpg, mtcars$hp)
points(sky1$mpg, sky1$hp, lwd=3)
# Grouped preference with dplyr
library(dplyr)
psel(group_by(mtcars, cyl), low(mpg))
# Return size of each maxima group
summarise(psel(group_by(mtcars, cyl), low(mpg)), n())
Run the code above in your browser using DataLab