## Loading required package: ggplot2
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
n <- 60
t <- seq(0, 2*pi, length=n)
x <- sin(t)
y <- cos(t)
#
par(pty = "s")
#
saveGIF(for (i in 1:n) {
plot.new()
plot.window(c(-1, 1), c(-1, 1))
lines(x*y, -y, col="gray")
points(x[i]*y[i], -y[i], pch=16,
col=gray((i-1)/(n+1)))
Sys.sleep(.05)
})## Output at: animation.gif
## [1] TRUE
/Users/Tjlee/Desktop/weather/animation.gif
#we can see n=1:60 are 60 plot #point character =pch #Sys.sleep(.05)= time interval .05