Press →, scroll, or swipe to advance
Made with Keydown
Department of Statistics, Iowa State University
Computational Statistics working group
Nov 2, 2011 (i.e. 20111102)
the best time to write a package was 5 years ago, and...
## rotate the word 'Animation' for (i in 1:360) { plot(1, ann = FALSE, type = "n", axes = FALSE) text(1, 1, "Animation", srt = i, col = rainbow(360)[i], cex = 7 * i/360) Sys.sleep(0.01) }
do not expect beginners to read source code, and do not expect experts to read documentation, either!
library(animation) demo('fire') # an application of image()
examples are fast guides to usage
library(animation) ?animation ## this gives you an overview of the package
\figure{}
)ani.start()
and ani.stop()
became saveHTML()
saveGIF()
uses ImageMagick or GraphicsMagick to convert images to GIF animations; need to know where they are installedreadRegistry()
(very likely to succeed)PATH
(very frustrating thanks to “the system that is just this tall”)foo_bar
than foo.bar
(why? S3 generic functions) or fooBar
(why? _
is a clearer separator than capital letters)parse()
and deparse()
1+1
and I return you 1 + 1
(what the heck is the difference?)well, compare
for(k in 1:10){j=cos(sin(k)*k^2)+3;print(j-5)}
to
for (k in 1:10) { j = cos(sin(k) * k^2) + 3 print(j - 5) }
tidy.eval()
functionI frown on this in homeworks (score: 99.5):
> 1+1 [1] 2
tidy.eval()
does this (score: 100):
1 + 1 ## [1] 2
##' This is title ##' @param a documentation for argument a ##' @param b documentation for argument b f = function(a, b) { ... }
R/f.R
and man/f.Rd
from
\arguments{ \item{a}{documentation for argument a} }
to
##' @param a documentation for argument a
=
instead of <-
?<-
to _
)=
=
)CvM2SL2Test
or HumMeth27QCReport