Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

46 lines
1.2KB

  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. }
  9. \arguments{
  10. \item{w}{a data_frame in the wide format}
  11. \item{key}{the key}
  12. \item{value}{the value}
  13. \item{...}{further arguments passed to gather, static_plot, or animate_plot}
  14. \item{export}{the export type, either gif, first or last. The latter two
  15. export ggplots of the first/last state of the gather function}
  16. \item{detailed}{boolean value if the animation should show one step for each
  17. key value}
  18. }
  19. \value{
  20. a gif or a ggplot
  21. }
  22. \description{
  23. Animates the gather function
  24. }
  25. \examples{
  26. wide <- data_frame(
  27. year = 2010:2011,
  28. Alice = c(105, 110),
  29. Bob = c(100, 97),
  30. Charlie = c(90, 95)
  31. )
  32. animate_gather(wide, "person", "sales", -year, export = "first")
  33. animate_gather(wide, "person", "sales", -year, export = "last")
  34. \donttest{
  35. animate_gather(wide, "person", "sales", -year, export = "gif")
  36. # if you want to have a less detailed animation, you can also use
  37. animate_gather(wide, "person", "sales", -year, export = "gif", detailed = FALSE)
  38. }
  39. }