Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

48 lines
1.3KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/animate_tidyr.R
  3. \name{animate_gather}
  4. \alias{animate_gather}
  5. \title{Animates the gather function}
  6. \usage{
  7. animate_gather(w, key, value, ..., export = "gif", detailed = TRUE,
  8. anim_opts = anim_options())
  9. }
  10. \arguments{
  11. \item{w}{a data_frame in the wide format}
  12. \item{key}{the key}
  13. \item{value}{the value}
  14. \item{...}{further arguments passed to \code{\link[tidyr:gather]{tidyr::gather()}}, \code{\link[=process_wide]{process_wide()}},
  15. or \code{\link[=process_long]{process_long()}}}
  16. \item{export}{the export type, either gif, first or last. The latter two
  17. export ggplots of the first/last state of the join}
  18. \item{detailed}{boolean value if the animation should show one step for each
  19. key value}
  20. }
  21. \value{
  22. a gif or a ggplot
  23. }
  24. \description{
  25. Animates the gather function
  26. }
  27. \examples{
  28. wide <- data_frame(
  29. year = 2010:2011,
  30. Alice = c(105, 110),
  31. Bob = c(100, 97),
  32. Charlie = c(90, 95)
  33. )
  34. animate_gather(wide, "person", "sales", -year, export = "first")
  35. animate_gather(wide, "person", "sales", -year, export = "last")
  36. \donttest{
  37. animate_gather(wide, "person", "sales", -year, export = "gif")
  38. # if you want to have a less detailed animation, you can also use
  39. animate_gather(wide, "person", "sales", -year, export = "gif", detailed = FALSE)
  40. }
  41. }