Draw vertical line at the max of x

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

Arguments

mapping

provide you own mapping, x is required

data

provide you own data

position

change geom

na.rm

remove missing values without warning, default is F

show.legend

show legend in plot, default is T

inherit.aes

should the geom inherits aesthetics from global, default is true

...

other arguments to be passed to the geom, see geom segment

Value

a ggplot2 layer

Examples

library(ggplot2) ggplot(data = cars, mapping = aes(x = dist)) + geom_histogram() + geom_xmax()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.