Search code examples
r-package

Vector images in R vignettes


I'm creating some vignettes using .Rmd files and knitr::rmarkdown.
When generating HTML output, my plots are being created as PNG images, then included in the vignette. I'd rather that they were included as vector images. Is there a way to do this?


Solution

  • I've found an answer to this question: add dev='svg' ('dev' abbreviates 'device') to the {R} block:

    {R Chunk name, echo=FALSE, [...], fig.height=3,  dev='svg'}