Skip to contents

A ggplot2 geom that draws lollipop (stem + point) plots for event metrics.

Usage

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

Arguments

mapping

Aesthetic mappings. Requires x and y.

data

The data to display.

stat

Statistical transformation. Default "identity".

position

Position adjustment. Default "identity".

...

Additional arguments.

na.rm

Remove NAs? Default FALSE.

show.legend

Show legend? Default NA.

inherit.aes

Inherit aesthetics? Default TRUE.

Value

A ggplot2 layer.

Examples

library(ggplot2)
df <- data.frame(x = as.Date("2020-01-01") + seq(0, 300, by = 30),
                 y = c(1.2, 2.1, 0.8, 3.5, 1.9, 2.7, 0.5, 1.1, 2.3, 1.6, 0.9))
ggplot(df, aes(x = x, y = y)) + geom_lolli3()