Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

50 lines
1.4KB

  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. \item{anim_opts}{An \code{\link[=anim_options]{anim_options()}} options list.}
  21. }
  22. \value{
  23. a gif or a ggplot
  24. }
  25. \description{
  26. Animates the gather function
  27. }
  28. \examples{
  29. wide <- data_frame(
  30. year = 2010:2011,
  31. Alice = c(105, 110),
  32. Bob = c(100, 97),
  33. Charlie = c(90, 95)
  34. )
  35. animate_gather(wide, "person", "sales", -year, export = "first")
  36. animate_gather(wide, "person", "sales", -year, export = "last")
  37. \donttest{
  38. animate_gather(wide, "person", "sales", -year, export = "gif")
  39. # if you want to have a less detailed animation, you can also use
  40. animate_gather(wide, "person", "sales", -year, export = "gif", detailed = FALSE)
  41. }
  42. }