Learn R Programming

svglite (version 1.0.0)

xmlSVG: Run plotting code and return svg

Description

This is useful primarily for testing. Requires the xml2 package.

Usage

xmlSVG(code, ..., standalone = FALSE)

Arguments

code
Plotting code to execute.
...
Other arguments passed on to svglite.
standalone
Produce a standalone svg file? If FALSE, omits xml header and default namespace.

Value

  • A xml2::xml_document object.

Examples

Run this code
if (require("xml2")) {
  x <- xmlSVG(plot(1, axes = FALSE))
  x
  xml_find_all(x, ".//text")
}

Run the code above in your browser using DataLab