Description Usage Arguments Details Examples
Writes SVG to file
1 |
svg |
XML document with SVG content. |
file |
Path to file or connection to write to (see |
remove_hidden |
Should hidden elements (with XML attribute display="none") be removed? (default TRUE) |
flatten |
Should grouping of SVG elements be removed? (default FALSE) |
Both remove_hidden=TRUE
and flatten=TRUE
do not alter the XML document object itself. Therefore, subsequent calls to stackedBar
and other functions remain possible.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #read SVG file
fpath <- system.file("extdata", "fig3.svg", package="svgtools")
svg <- read_svg(file = fpath)
#adjust some elements of SVG
svg <- stackedBar(svg = svg, frame_name = "frame", group_name = "overall",
scale_real = c(0,160), values = c(10,42,106),
alignment = "vertical")
## Not run:
#write SVG file to disk and remove all groupings
write_svg(svg = svg, file = "myChart.svg", flatten = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.