svgedit

svgedit allows creating figures with complex layout programmatically in R, by using an SVG file as a template.

Installation

You can install svgedit from CRAN with:

install.packages("svgedit")

Workflow

There are four main steps to use svgedit:

  1. Create an SVG template file using the Inkscape graphics editor
  2. Create your figure layout in the SVG file, including:
  3. Open Inkscape’s “Layers and Objects” (Ctrl + Shift + L), and click on your placeholder elements to set their labels
  4. In R, use svgedit to replace the placeholders with your plots, images, and text

Example

See the package vignette by running vignette("multi-panel-figure", package = "svgedit") for an example use.