get_frontier: Compute the Pareto Optimal Frontier

Description Usage Arguments Value See Also Examples

View source: R/get_frontier.R

Description

Extract the points that make up the Pareto frontier from a set of data.

Usage

1
2
get_frontier(data, x, y, quadrant = c("top.right", "bottom.right",
  "bottom.left", "top.left"), decreasing = TRUE)

Arguments

data

A data frame.

x

A numeric vector.

y

A numeric vector.

quadrant

Chararacter string specifying which quadrant the frontier should appear in. Default is "top.right".

decreasing

Logical value indicating whether the data returned is in decreasing or ascending order (ordered by x and then y). Default is decreasing order.

Value

A data frame containing the data points that make up the efficient frontier.

See Also

geom_frontier for plotting the Pareto front

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# default will find the Pareto optimal observations in top right quadrant
get_frontier(mtcars, mpg, wt)

# the output can be in descending or ascending order
get_frontier(mtcars, mpg, wt, decreasing = FALSE)

# use quadrant parameter to change how you define the efficient frontier
get_frontier(airquality, Ozone, Temp, quadrant = 'top.left')

get_frontier(airquality, Ozone, Temp, quadrant = 'bottom.right')

koalaverse/KraljicMatrix documentation built on May 25, 2019, 9:30 p.m.