read_svg: Read SVG file and return XML document

Description Usage Arguments Value Examples

View source: R/svgtools.R

Description

Read SVG file and return XML document

Usage

1
read_svg(file, enc = "UTF-8", summary = FALSE, display = FALSE)

Arguments

file

A string, a connection, or a raw vector. See read_xml.

enc

Encoding (default 'UTF-8').

summary

Show summary of SVG file (summary_svg)? (default FALSE)

display

Display SVG on standard display port (display_svg)? (default FALSE)

Value

XML document with SVG content

Examples

1
2
fpath <- system.file("extdata", "fig1.svg", package="svgtools")
svg <- read_svg(file = fpath, summary = TRUE)

Example output

[1] "************************"
[1] "** -- SVG SUMMARY: -- **"
[1] "************************"
[1] "-- NAMED GROUPS:"
[1] "myBars with 5 children"
[1] "-- AVAILABLE FRAMES:"
[1] "myFrame"
[1] "-- USED FONTS:"
[1] "'ArialMT'"
[1] "-- USED FONT SIZES:"
[1] "12" "10"
[1] "-- USED COLORS:"
[1] "#C6C6C6" "#878787" "#3C3C3B" "none"    "#000000"

svgtools documentation built on Dec. 14, 2021, 5:10 p.m.