data("austres")
<- data.frame(x=as.matrix(austres), date=time(austres))
dt $y <- rnorm(nrow(dt))
dt$date <- as.numeric(dt$date) dt
A new R packge (
gganimate
) provides some new features for animation in R. Its big advantage is it could make use of ggplot API and embeded into ggplot. Next, I will use a sample data to show the example. Then I will use some real educational data to explore a little bit what we can do in psychometric area.
1 A Simple Example
I want to introduce this package.
1.1 1.0 Load the packages requried
1.2 1.1 prepare the data
1.2.1 transition_reveal
: gradually reveal the data
+ transition_reveal(date) p
`geom_line()`: Each group consists of only one observation.
ℹ Do you need to adjust the group aesthetic?
`geom_line()`: Each group consists of only one observation.
ℹ Do you need to adjust the group aesthetic?
$g <- rep( c("red", "green", "blue"), length.out = nrow(dt)) dt
<- ggplot(dt,
p_bygroup aes(y = y, x =x, col = g)) +
geom_line(alpha = 0.7) +
geom_point()
p_bygroup