R 如何使用几何点在gganimate中创建状态之间的平滑过渡?

R 如何使用几何点在gganimate中创建状态之间的平滑过渡?,r,ggplot2,gganimate,R,Ggplot2,Gganimate,我正在尝试使用gganimate创建动画情节。 当我将以下因素dat$周期传递到过渡状态时, 我得到3张静态图像。我更愿意让分数从州“移动”到- 国家 这是我的密码: plot <- ggplot(data = dat, aes(x = age, y = value, color = period)) + geom_point(size = 3, aes(group = period)) + facet_wrap(~group)+

我正在尝试使用gganimate创建动画情节。
当我将以下因素dat$周期传递到过渡状态时,
我得到3张静态图像。我更愿意让分数从州“移动”到- 国家

这是我的密码:

plot <-
          ggplot(data = dat, aes(x = age, y = value, color = period)) +
          geom_point(size = 3, aes(group = period)) +
          facet_wrap(~group)+
          transition_states(states=period, transition_length = 2, state_length = 1) +
          ease_aes('linear')+
          enter_fade()+
          exit_fade()

plot

点出现/消失-我希望点在屏幕上的状态之间移动-任何帮助都可以使用
美学来确定每个时段数据中的哪些行被视为相同的对象。您需要
group=record
此处:

ggplot(data = dat, aes(x = age, y = value, color = period)) +
    geom_point(size = 3, aes(group = record)) +
    facet_wrap(~ group)+
    transition_states(states=period, transition_length = 2, state_length = 1) +
    ease_aes('linear')+
    enter_fade()+
    exit_fade()

ggplot(data = dat, aes(x = age, y = value, color = period)) +
    geom_point(size = 3, aes(group = record)) +
    facet_wrap(~ group)+
    transition_states(states=period, transition_length = 2, state_length = 1) +
    ease_aes('linear')+
    enter_fade()+
    exit_fade()