The frontier geom is used to overlay the efficient frontier on a scatterplot.

geom_frontier(mapping = NULL, data = NULL, position = "identity",
  direction = "vh", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE,
  ...)

stat_frontier(mapping = NULL, data = NULL, geom = "step",
  position = "identity", direction = "vh", na.rm = FALSE,
  show.legend = NA, inherit.aes = TRUE, quadrant = "top.right", ...)

Arguments

mapping

Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

data

The data to be displayed in this layer.

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

direction

Direction of stairs: 'vh' for vertical then horizontal, or 'hv' for horizontal then vertical.

na.rm

If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed.

show.legend

Logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes.

inherit.aes

If FALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. borders.

...

Other arguments passed on to layer. These are often aesthetics, used to set an aesthetic to a fixed value, like color = "red" or size = 3. They may also be parameters to the paired geom/stat.

geom

Use to override the default connection between geom_frontier and stat_frontier.

quadrant

See get_frontier.

Examples

not_run({ # default will find the efficient front in top right quadrant ggplot(mtcars, aes(mpg, wt)) + geom_point() + geom_frontier() # change the direction of the steps ggplot(mtcars, aes(mpg, wt)) + geom_point() + geom_frontier(direction = 'hv') # use quadrant parameter to change how you define the efficient frontier ggplot(airquality, aes(Ozone, Temp)) + geom_point() + geom_frontier(quadrant = 'top.left') ggplot(airquality, aes(Ozone, Temp)) + geom_point() + geom_frontier(quadrant = 'bottom.right') })