iNZightPlots (version 2.12.4)

exportHTML: 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(assets_dir, "index.html"),
  data,
  local = FALSE,
  assets_dir = tempdir(),
  extra.vars,
  ...
)

# S3 method for `function` exportHTML( x, file = file.path(assets_dir, "index.html"), data = NULL, local = FALSE, assets_dir = tempdir(), extra.vars = NULL, width = dev.size()[1], height = dev.size()[2], ... )

# S3 method for ggplot exportHTML( x, file = file.path(assets_dir, "index.html"), data = NULL, local = FALSE, assets_dir = tempdir(), extra.vars = NULL, mapObj, ... )

# S3 method for inzplotoutput exportHTML( x, file = file.path(assets_dir, "index.html"), data = NULL, local = FALSE, assets_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 `assets_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)

assets_dir

Directory to store results (defaults to `tempdir()`)

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)

  • function: method for an iNZightPlot-generating function

  • ggplot: method for iNZightMaps or other supported ggplot graphs

  • inzplotoutput: method for output from iNZightPlot

Examples

Run this code
# 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"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab