Skip to contents

Bar, pie/doughnut charts

Usage

x_bar(w, x = "x", y = "y", fill = NULL)

x_pie(w, x = "x", y = "y", radius = 0.5)

Arguments

w

an xkcd widget object

x

x variable

y

y variable for bar height or arc length in pie chart

fill

optional group variable mapped to bar fill

radius

specify empty pie chart radius, default to 0.5 For pie chart set radius = 0

Examples

data.frame(
  x = LETTERS[1:6],
  y = abs(rnorm(6))
) |>
  x_chart() |>
  x_bar()