geom_text_count_percent: geom_text_count_percent

View source: R/text_count_percentage.R

geom_text_count_percentR Documentation

geom_text_count_percent

Description

Add label which is the count as well as percentage. Acts like geom_bar() but text label at the position of the top of the bar. Percentage is calculated within facet panels.

Usage

geom_text_count_percent(
  nudge_y = 0,
  lineheight = 0.85,
  position = ggplot2::position_dodge2(width = 0.9, preserve = "single"),
  ...
)

Arguments

...

Examples

library(ggplot2)
ggplot(mtcars) +
    aes(x = cyl) +
    geom_bar() +
    geom_text_count_percent(nudge_y = .5)

EvaMaeRey/ggdirect documentation built on Sept. 29, 2023, 12:36 a.m.