Skip to contents

Creates an animated bar chart from a data frame.

Usage

animate_bar_chart(
  data,
  x,
  y,
  fill = NULL,
  transition = "grow",
  duration = 2,
  name = "bar_animation"
)

Arguments

data

A data frame

x

Column for categories (x-axis)

y

Column for values (y-axis)

fill

Column for bar fill color (optional)

transition

Type of transition ("grow", "fade")

duration

Animation duration

name

Scene name

Value

A Scene object

Examples

if (FALSE) { # \dontrun{
data.frame(category = c("A", "B", "C"), value = c(10, 25, 15)) %>%
  animate_bar_chart(category, value) %>%
  render()
} # }