add a charming endpoint to your lines

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

Arguments

...

Value

Examples

# functions
geom_line_endpoint
#> function (mapping = NULL, data = NULL, position = "identity", 
#>     na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...) 
#> {
#>     ggplot2::layer(stat = StatLineendpoint, geom = ggplot2::GeomPoint, 
#>         data = data, mapping = mapping, position = position, 
#>         show.legend = show.legend, inherit.aes = inherit.aes, 
#>         params = list(na.rm = na.rm, ...))
#> }
#> <bytecode: 0x7fa460acb0f0>
#> <environment: namespace:ggdirect>
library(ggplot2)
ggplot(cars) +
   aes(x = speed, y = dist) +
   geom_line() +
   geom_line_endpoint()


ggplot(cars) +
    aes(x = speed, y = dist, color = dist > 15) +
    geom_line() +
    geom_line_endpoint()


ggplot(cars) +
     aes(x = speed, y = dist,
         color = dist > 15,
         linetype = speed > 16) +
     geom_line() +
     geom_line_endpoint()