Skip to contents

Creates an animated scatter plot where points appear one by one or in groups. Supports color mapping, size mapping, and trajectories.

Usage

animate_data_scatter(
  data,
  x,
  y,
  color = BLUE,
  size = NULL,
  label = NULL,
  group = NULL,
  axes = NULL,
  transition = "grow",
  duration = 3,
  stagger = NULL
)

Arguments

data

A data.frame with columns for x, y, and optional aesthetics

x

Column name or index for x coordinates

y

Column name or index for y coordinates

color

Column name for color mapping (or single color)

size

Column name for size mapping (or single size)

label

Column name for labels

group

Column name for grouping

axes

Axes object (NULL = auto-create)

transition

Animation style: "appear", "grow", "fade", "trail"

duration

Total animation duration

stagger

Time delay between points (NULL = auto)

Value

A Scene object with the animation