Learn R Programming

rPref (version 0.6)

plot_front: Pareto Front Plot

Description

Connects the points of a Pareto front (also known as Pareto frontier) and hence visualizes the dominance region of a Skyline.

Usage

plot_front(df, pref, ...)

Arguments

df
The data frame for which the Pareto front is plotted. This may be already a maxima set w.r.t. the preference pref, but anyway the maxima set is recalculated via psel(df, pref).
pref
The preference representing the Skyline goals. This must be a pareto composition (p1 * p2) or intersection composition (p1 | p2) of two low or hig
...
Additional graphic parameters which are passed to the segments function (internally used to plot the front).

Details

plot_front assumes that there is an existing plot, where the value of the first preference was plotted as x-coordinate and the value of the second preference as y-coordinate.

Examples

Run this code
# plots Pareto fronts for the hp/mpg values of mtcars
show_front <- function(pref) {
  plot(mtcars$hp, mtcars$mpg)
  sky <- psel(mtcars, pref)
  plot_front(mtcars, pref, col = rgb(0, 0, 1))
  points(sky$hp, sky$mpg, lwd = 3)
}

# do this for all four combinations of Pareto compositions
show_front(low(hp)  * low(mpg))
show_front(low(hp)  * high(mpg))
show_front(high(hp) * low(mpg))
show_front(high(hp) * high(mpg))

# compare this to the front of a intersection preference
show_front(high(hp) | high(mpg))

Run the code above in your browser using DataLab