我想使用 gganimate 记录测试情况下的进度:到目前为止,我已经完成了:
library(tidyverse)
library(gganimate)
data <- tribble(~user, ~agree, ~accord, ~messung,
"1", .8, .9, 1,
"2",.7, .8, 1,
"3", .6, .9, 1)
data2 <- tribble(~user, ~agree2, ~accord2, ~messung2,
"1", .4, .7, 2,
"2", .5, .9, 2,
"3", .9, .9, 2)
data%>%
left_join(data2)%>%
mutate(user = as.numeric(user))%>%
ggplot(aes(x = accord, y = agree))+
geom_point(aes(fill = "grey"), color = "grey", size = 2)+
geom_point(aes(x = accord2, y = agree2), color = "green",
size = 2)+
xlim(0,1)+
ylim(0,1)+
geom_segment(aes(x = accord,
y = agree,
xend = accord2,
yend = agree2),
size = 0.5, arrow = arrow(type="closed", length =
unit(.08, "inches"), angle = 30),
color = "grey")+
theme_minimal()+
guides(fill=FALSE, color=FALSE)+
transition_manual(user)
首先,颜色和表示是次要的。重要的是要学习如何一个接一个地为这些点设置动画,而不会使之前的点再次消失?欢迎任何帮助!谢谢

