Icons created from an SVG file (such as those from an icon_set(), or
read directly with read_icon()) retain the path to their source file.
This is useful for passing icons to other packages that work with SVG
files directly, such as ggplot2 (via grid::rasterGrob() or similar) or
gt.
icon_path(x)A character vector giving the path(s) to the icon's source SVG file(s) on disk.
path <- tempfile(fileext = ".svg")
writeLines(
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0"/></svg>',
path
)
icon_path(read_icon(path))
#> [1] "/tmp/Rtmp1yL1cM/file19a69c2fd57.svg"