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

45 lines
1.3KB

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