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.

40 Zeilen
902B

  1. # Animated dplyr joins with gganimate
  2. # * Garrick Aden-Buie
  3. # * garrickadenbuie.com
  4. # * MIT License: https://opensource.org/licenses/MIT
  5. # Note: I used Fira Sans and Fira Mono fonts.
  6. # Use search and replace to use a different font if Fira is not available.
  7. library(tidyverse)
  8. library(gganimate)
  9. if (!getOption("tidy_verb_anim.font_registered", FALSE)) {
  10. source(here::here("R", "01_register-fonts.R"))
  11. }
  12. if (!getOption("tidy_verb_anim.functions_loaded", FALSE)) {
  13. source(here::here("R", "02_functions.R"))
  14. }
  15. if (!dir.exists(here::here("images"))) dir.create(here::here("images"))
  16. # Data ----
  17. x <- tibble::tribble(
  18. ~id, ~x, ~y,
  19. 1, "x1", "y1",
  20. 2, "x1", "y2",
  21. 3, "x2", "y1"
  22. )
  23. y <- tibble::tribble(
  24. ~id, ~x, ~y,
  25. 1, "x1", "y1",
  26. 4, "x2", "y2"
  27. )
  28. initial_dfs <- proc_data2(x, "x") %>%
  29. bind_rows(mutate(proc_data2(y, "y"), .x = .x + 4)) %>%
  30. mutate(frame = 1)