Learn R Programming

R2SWF (version 0.7-1)

swf: SWF graphics device

Description

This function opens a SWF device that produces Flash animation in SWF format. Every time you call a high level plotting function like plot(), the movie will create a new frame and draw following shapes on it.

Usage

swf(file = "Rplots.swf", width = 7, height = 7,
    bg = "white", fg = "black", frameRate = 12)

Arguments

file
a character string giving the output SWF file
width
the width of the device in inches
height
the height of the device in inches
bg
the background color of the SWF file
fg
initial foreground color
frameRate
how many frames to be played in 1 second

Examples

Run this code
## A demonstration of K-means clustering, using animation package
if(require(animation)) {
    swf("kmeans.swf", frameRate = 1)
    kmeans.ani()
    dev.off()
}

Run the code above in your browser using DataLab