data(mtcars)
# assume we want to maximize horsepower and minimize gas consumption
cars = mtcars[, c("mpg", "hp")]
cars$hp = -cars$hp
idxs = which.nondominated(as.matrix(cars))
print(mtcars[idxs, ])
Run the code above in your browser using DataLab