
Figure 3: Schematic structure of a gvis list object.
data requirements follow those of the Google Charts API and are documented in
the help pages, see
R> help('gvisMotionChart')
The argument chartid allows the user to set a chart id of the output c hart man-
ually. If the argument is missing a random id using tempfile(pattern='') will
be generated. Unique chart ids are required to place more than one chart on a web
page.
The output of a googleVis function is a list of lists (a nested list) containing
information about the chart type, chart id and the html code in a sub-list with
header, chart, caption and footer, see Figure 3.
The idea behind this concept is that users can get a complete web page, while at
the same time offer a facility to extract specific parts, such as the chart itself. This
is particularly helpful if the package functions are used in solutions where the user
wants to feed the visualisation output into other sites, or would like to embed them
into rsp-pages (see page 26), use RApache (see page 26) or Google Gadgets.
The output of a googleVis function will be of class ’gvis’ and ’list’. Generic
print (print.gvis) and plot (plot.gvis) functions exist to ease the handling of
such objects.
To illustrate the concept we shall create a motion chart using the Fruits data set.
9
Comentários a estes Manuais