|
- % Generated by roxygen2: do not edit by hand
- % Please edit documentation in R/animate_tidyr.R
- \name{animate_gather}
- \alias{animate_gather}
- \title{Animates the gather function}
- \usage{
- animate_gather(w, key, value, ..., export = "gif", detailed = TRUE,
- anim_opts = anim_options())
- }
- \arguments{
- \item{w}{a data_frame in the wide format}
-
- \item{key}{the key}
-
- \item{value}{the value}
-
- \item{...}{further arguments passed to \code{\link[tidyr:gather]{tidyr::gather()}}, \code{\link[=process_wide]{process_wide()}},
- or \code{\link[=process_long]{process_long()}}}
-
- \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{anim_opts}{An \code{\link[=anim_options]{anim_options()}} options list.}
- }
- \value{
- a gif or a ggplot
- }
- \description{
- Animates the gather function
- }
- \examples{
- wide <- data_frame(
- year = 2010:2011,
- Alice = c(105, 110),
- Bob = c(100, 97),
- Charlie = c(90, 95)
- )
- animate_gather(wide, "person", "sales", -year, export = "first")
- animate_gather(wide, "person", "sales", -year, export = "last")
-
- \donttest{
- animate_gather(wide, "person", "sales", -year, export = "gif")
- # if you want to have a less detailed animation, you can also use
- animate_gather(wide, "person", "sales", -year, export = "gif", detailed = FALSE)
- }
- }
|