View source: R/get_attributes.R
get_attributes | R Documentation |
SVG files and the imported representation of class 'XMLsvg' are hierarchically organized in node sets and nodes. Each node is a graphical object such as a path, rectangle, or text. The attributes of these nodes can be queried using this function. Attributes relate to the _style_ of an element. If you want to retrieve the _values_ of an element (e.g. content of a text field), use 'get_values()' instead.
get_attributes(xml, node = NULL, node_attr = "label", attr = NULL)
xml |
(XMLsvg) XMLsvg object obtained from 'read_svg()' |
node |
(character) node(s) to be displayed. Node names are searched using the 'node_attr' field |
node_attr |
(character) name of the attribute by which target nodes are filtered (default: "label") |
attr |
(character) the desired attribute to be displayed, such as 'id', 'style' |
Returns a 'tibble' with rows being the selected nodes and columns being the selected attributes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.