animate_points: Simple animation of regular points

Description Usage Arguments Details Value

View source: R/s5_interpolate_animate.R

Description

Provides a simple animation of a reg_points object.

Usage

1
2
animate_points(reg_points, ani.width = 800, ani.height = 600,
...)

Arguments

reg_points

An object of class reg_points to create the animation.

ani.width

Width of the animation in pixels. Passed to animation::ani.options().

ani.height

Height of the animation in pixels. Passed to animation::ani.options().

Details

This function quickly creates a simple animation of a reg_points object returned by regular_points(). It uses the package gganimate to make an animation. The function returns an object of class gganim, so the user can manipulate the object prior to printing just as they would manipulate any ggplot with `+`. Printing the object automatically renders the animation using animate.

We encourage the user to explore gganimate for producing their own custom animations from the interpolated regular points returned by regular_points(). The source code from this function could serve as a starting point.

1
2
3
4
5
    ani <- ggplot(reg_points) +
      geom_sf(aes(color = id), key_glyph = "point") +
      theme_bw() +
      transition_time(time = dt) +
      labs(title = 'Time: {frame_time}', color = "ID")

Value

Returns an object of class gganim from package gganimate.


bsmity13/ADePTR documentation built on Nov. 9, 2019, 12:43 a.m.