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", ...)
mapping | Set of aesthetic mappings created by |
---|---|
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 |
show.legend | Logical. Should this layer be included in the legends?
|
inherit.aes | If |
... | Other arguments passed on to |
geom | Use to override the default connection between
|
quadrant | See |
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') })