exportHTML {iNZightPlots} | R Documentation |
ExportHTML
Description
exportHTML
is designed to export the iNZight plot as a dynamic, interactive HTML page.
Currently only handles single panel plots. Coloured hex plots are currently not available yet.
Usage
exportHTML(
x,
file = file.path(dir, "index.html"),
data,
local = FALSE,
dir = tempdir(),
extra.vars,
...
)
## S3 method for class ''function''
exportHTML(
x,
file = file.path(dir, "index.html"),
data = NULL,
local = FALSE,
dir = tempdir(),
extra.vars = NULL,
width = dev.size()[1],
height = dev.size()[2],
...
)
## S3 method for class 'ggplot'
exportHTML(
x,
file = file.path(dir, "index.html"),
data = NULL,
local = FALSE,
dir = tempdir(),
extra.vars = NULL,
mapObj,
...
)
## S3 method for class 'inzplotoutput'
exportHTML(
x,
file = file.path(dir, "index.html"),
data = NULL,
local = FALSE,
dir = tempdir(),
extra.vars = NULL,
...
)
Arguments
x |
An iNZight plot object that captures iNZight environment |
file |
Name of temporary HTML file generated (defaults to 'index.html' in a temporary directory, or other as specified using 'dir') |
data |
dataset/dataframe that you wish to investigate and export more variables from |
local |
Logical for creating local files for offline use (default to false) |
dir |
A directory to store the file and output |
extra.vars |
extra variables specified by the user to be exported |
... |
extra arguments |
width |
the desired width of the SVG plot |
height |
the desired height of the SVG plot |
mapObj |
iNZightMap object (from iNZightMaps) |
Value
an inzHTML object consisting of a link to an HTML rendering
of x
with filename file
,
which can be loaded in the browser (for example using browseURL
,
or calling the print()
method of the returned object.
Methods (by class)
-
exportHTML(`function`)
: method for an iNZightPlot-generating function -
exportHTML(ggplot)
: method for iNZightMaps or other supported ggplot graphs -
exportHTML(inzplotoutput)
: method for output from iNZightPlot
Author(s)
Yu Han Soh
Examples
## Not run:
x <- iNZightPlot(Petal.Width, Petal.Length, data = iris, colby = Species)
exportHTML(x, "index.html")
#to export more variables for scatterplots:
exportHTML(x, "index.html", data = iris, extra.vars = c("Sepal.Length", "Sepal.Width"))
## End(Not run)