as.data.frame.dynet_animation: Coerce an animation to a data frame

View source: R/animate.R

as.data.frame.dynet_animationR Documentation

Coerce an animation to a data frame

Description

Coerce an animation to a data frame

Usage

## S3 method for class 'dynet_animation'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  what = c("bins", "frames"),
  ...
)

Arguments

x

A dynet_animation from animate().

row.names, optional

As in base::as.data.frame().

what

"bins", the default, for one row per bin with the columns animate() documents; "frames" for one row per rendered frame, with frame, bin (the bin the frame belongs to), phase (how far along the transition to the next bin, in ⁠[0, 1)⁠) and time (where the timeline marker stands).

...

Ignored.

Value

A plain data.frame.

Examples

if (requireNamespace("gifski", quietly = TRUE) &&
  requireNamespace("cograph", quietly = TRUE)) {
  dn <- dynet(school_contacts)
  frames <- animate(dn, step = 6, window = 6, tween = 2)
  as.data.frame(frames)
  as.data.frame(frames, what = "frames")
}

Dynet documentation built on Oct. 7, 2026, 5:08 p.m.