Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

48 Zeilen
1.4KB

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