forked from gadenbuie/tidyexplain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
full_join.R
29 lines (23 loc) · 822 Bytes
/
full_join.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
source(here::here("R/00_base_join.R"))
fj_joined_df <- full_join(x, y, "id") %>%
proc_data("x") %>%
mutate(.id = ifelse(value %in% c("4", "y4"), "y", .id)) %>%
mutate(frame = 2, .x = .x + 1)
fj_extra_blocks <- inner_join(x, y, "id") %>%
select(id) %>%
proc_data("y") %>%
mutate(frame = 2, .x = .x + 1)
fj <- initial_join_dfs %>%
bind_rows(fj_joined_df, fj_extra_blocks) %>%
plot_data("full_join(x, y)") +
transition_states(frame, transition_length = 2, state_length = 1) +
enter_appear() +
exit_disappear(early = TRUE) +
ease_aes("sine-in-out")
fj <- animate(fj)
anim_save(here::here("images", "full-join.gif"), fj)
fj_g <- full_join(x, y, "id") %>%
proc_data() %>%
mutate(.x = .x + 1) %>%
plot_data_join("full_join(x, y)", ylims = ylim(-4.5, -0.5))
save_static_plot(fj_g, "full-join")