data(ha)
shp <- system.file("shapes/berlin.shp",package="surveillance")
has4 <- disProg2sts(ha, map=readShapePoly(shp,IDvar="SNAME"))
print(has4)
plot(has4, type= observed ~ time)
plot(has4, type= observed ~ time | unit)
plot(has4, type= observed ~ 1 | unit)
plot(has4[1:20,1:2], type= observed ~ 1 | unit)
plot(aggregate(has4,nfreq=13), type= observed ~ 1 | unit * time)
#Configure a png device printer for the plot command
dev.printer <-
list(device=png,extension=".png",width=640,height=480,name="/tmp/berlin")
#Do the animation
plot(aggregate(has4,nfreq=13), type = observed ~ 1 | unit * time,
dev.printer=dev.printer)
#Use ImageMagick -- replace /sw/bin/convert by your path to convert
system(paste("/sw/bin/convert -delay 50 ",dev.printer$name,
"*.png /tmp/animated.gif",sep=""))
Run the code above in your browser using DataLab