g.brownian.motion {animation} | R Documentation |
We can use R to generate random numbers from the Normal distribution and write them into an HTML document, then the Google Visualization gadget ``motionchart'' will prepare the animation for us (a Flash animation with several buttons).
g.brownian.motion(p = 20, start = 1900, digits = 14, file = "brownian.motion.html", width = 800, height = 600)
p |
number of points |
start |
start "year"; it has no practical meaning in this animation but it's the required by the Google gadget |
digits |
the precision to round the numbers |
file |
the file name |
width, height |
width and height of the animation |
NULL
. An HTML page will be opened as the side effect.
The number of frames is controlled by ani.options("nmax")
as usual.
Yihui Xie
http://code.google.com/apis/visualization/
http://www.yihui.name/en/post/57.htm
brownian.motion
, BM.circle
, rnorm
## Not run: g.brownian.motion(15, digits = 2, width = 600, height = 500) ## End(Not run)