You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
822B

  1. source(here::here("R/00_base_join.R"))
  2. fj_joined_df <- full_join(x, y, "id") %>%
  3. proc_data("x") %>%
  4. mutate(.id = ifelse(value %in% c("4", "y4"), "y", .id)) %>%
  5. mutate(frame = 2, .x = .x + 1)
  6. fj_extra_blocks <- inner_join(x, y, "id") %>%
  7. select(id) %>%
  8. proc_data("y") %>%
  9. mutate(frame = 2, .x = .x + 1)
  10. fj <- initial_join_dfs %>%
  11. bind_rows(fj_joined_df, fj_extra_blocks) %>%
  12. plot_data("full_join(x, y)") +
  13. transition_states(frame, transition_length = 2, state_length = 1) +
  14. enter_appear() +
  15. exit_disappear(early = TRUE) +
  16. ease_aes("sine-in-out")
  17. fj <- animate(fj)
  18. anim_save(here::here("images", "full-join.gif"), fj)
  19. fj_g <- full_join(x, y, "id") %>%
  20. proc_data() %>%
  21. mutate(.x = .x + 1) %>%
  22. plot_data_join("full_join(x, y)", ylims = ylim(-4.5, -0.5))
  23. save_static_plot(fj_g, "full-join")