if (FALSE) {
## A demonstration of K-means clustering, using animation package
olddir = setwd(tempdir())
if(require(animation)) {
swf("kmeans.swf", frameRate = 1)
kmeans.ani()
dev.off()
}
## Test built-in fonts in sysfonts package
swf("fonts.swf", 8, 8)
plot(1, type = "n")
par(family = "sans", cex = 2)
text(0.7, 1.3, "Sans-R", font = 1)
text(0.7, 1.1, "Sans-B", font = 2)
text(0.7, 0.9, "Sans-I", font = 3)
text(0.7, 0.7, "Sans-BI", font = 4)
par(family = "serif")
text(1.0, 1.3, "Serif-R", font = 1)
text(1.0, 1.1, "Serif-B", font = 2)
text(1.0, 0.9, "Serif-I", font = 3)
text(1.0, 0.7, "Serif-BI", font = 4)
par(family = "mono")
text(1.3, 1.3, "Mono-R", font = 1)
text(1.3, 1.1, "Mono-B", font = 2)
text(1.3, 0.9, "Mono-I", font = 3)
text(1.3, 0.7, "Mono-BI", font = 4)
dev.off()
setwd(olddir)
}
Run the code above in your browser using DataLab