14.2 Outputting to SVG Vector Files

14.2.1 Problem

You want to create a scalable vector graphics (SVG) image of your plot.

14.2.3 Discussion

Although R has a built-in svg() function that can generate SVG output, the svglite package provides more standards-compliant output.

When it comes to importing images, some programs may handle SVG files better than PDFs, and vice versa. For example, web browsers tend to have better SVG support, while document-creation programs like LaTeX tend to have better PDF support.