1. Go to http://www.macromedia.com/support/documentation/en/flashplayer/
help/settings_manager04.html
2. Click on the dropbox which says ’Edit location’ and choose ’add location’
3. Click ’browse for folder’
4. Choose the folder in which you saved your html file
5. Click OK
Now op en your googleVis html file and it should display successfully.
Alternatively use the function plot.gvis explicitly, e.g. suppose your html file
is stored in /Users/JoeBloggs/myGoogleVisChart.html. Using the plot.gvis
the file will be copied into a te mporary directory and displayed via the R HTTP help
server with, in the same way as a gvis-object:
R> plot.gvis("/Users/JoeBloggs/myGoogleVisChart.html")
Please note that this feature of plot.gvis was intro duced to googleVis with
version 0.3.2.
2.5 Setting default behaviour of print.gvis and plot.gvis
In googleVis version 0.3.2 the function plot.gvis gained the same argument as
print.gvis: tag. By default the tag argument is set to NULL in plot.gvis and
the plot function will display its output in a browser window. However, if tag is
not NULL the function plot.gvis will behave exactly like print.gvis.
The default tag can be set for both functions globally via the options() func-
tion. On package load googleVis sets options(gvis.print.tag=’html’) and
options(gvis.plot.tag=NULL).
Suppose you would set options(gvis.plot.tag=’chart’) then all following plot
statements would print the chart part of the gvis-object only, without opening a
browser window. This might seem a bit odd at first, yet it becomes helpful when
you write R Markdown files for knitr or files for other packages such as R.rsp.
While you draft your file you may want to see the output of googleVis in an
interactive way, so you set options(gvis.plot.tag=NULL) at the top of the file
and you change the setting to ’chart’ before you parse the file, say with knitr.
This will ensure that all plot statements return the HTML code of the chart, rather
than opening browser windows. Section 4 on page 32 provides more details and a
little knitr example.
17
Comentários a estes Manuais