ani.start {animation}R Documentation

Start the generation of an HTML animation page

Description

Copy JavaScript file ‘FUN.js’ and CSS file ‘ANI.css’ to the same directory as the HTML animation page and write the header part of the HTML page. The prompt of the current R session is modified (by default ANI>).

Usage

ani.start(outdir = tempdir(), filename = "index", extension = "htm", 
    withprompt = "ANI> ", Title = "Animated Statistics Using R")

Arguments

outdir physical directory to store the animation output
filename name of the target HTML main file
extension extension of the target HTML file (htm, html,...)
withprompt prompt to display while using ani.start (restore with ani.stop)
Title string to pass to HTML <title> tag

Details

A new environment called ANIenv is build, where internal variables such as physical path are stored. This environment is not visible to the user. It is destroyed when calling ani.stop.

Only a part of the HTML page is written (such as the head area), and the rest part will be completed by ani.stop.

Value

None (invisible `NULL').

Note

After calling ani.start, either animation functions in this package or R script of your own can be used to generate & save animated pictures using savePNG, then watch your animation by ani.stop(autobrowse = TRUE).

Author(s)

Yihui Xie

See Also

savePNG, ani.stop

Examples

## Not run: 
 
# save the animation in HTML pages and auto-browse it 
ani.start()
boot.iid(saveANI = TRUE, width = 600, height = 500, interval = 0.2)
ani.stop()

## End(Not run)

[Package animation version 0.2-0 Index]