|
- % Generated by roxygen2: do not edit by hand
- % Please edit documentation in R/animate_tidyr.R
- \name{animate_spread}
- \alias{animate_spread}
- \title{Animates the spread function}
- \usage{
- animate_spread(l, key, value, export = "gif", detailed = TRUE, ...,
- anim_opts = NULL)
- }
- \arguments{
- \item{l}{a data_frame in the long/tidy format}
-
- \item{key}{the key}
-
- \item{value}{the value}
-
- \item{export}{the export type, either gif, first or last. The latter two
- export ggplots of the first/last state of the join}
-
- \item{detailed}{boolean value if the animation should show one step for each
- key value}
-
- \item{...}{further arguments passed to \link{process_long} or \link{process_wide}}
-
- \item{anim_opts}{An \code{\link[=anim_options]{anim_options()}} options list.}
- }
- \value{
- a ggplot or a gif
- }
- \description{
- Animates the spread function
- }
- \examples{
- long <- data_frame(
- year = c(2010L, 2011L, 2010L, 2011L, 2010L, 2011L),
- person = c("Alice", "Alice", "Bob", "Bob", "Charlie", "Charlie"),
- sales = c(105, 110, 100, 97, 90, 95)
- )
- animate_spread(long, key = "person", value = "sales", export = "first")
- animate_spread(long, key = "person", value = "sales", export = "last")
-
- \donttest{
- animate_spread(long, key = "person", value = "sales", export = "gif")
- # if you want to have a less detailed animation, you can also use
- animate_spread(long, key = "person", value = "sales", export = "gif", detailed = FALSE)
- }
- }
|