Journal of Statistical Software (Apr 2009)
Importing Vector Graphics: The grImport Package for R
Abstract
This article describes an approach to importing vector-based graphical images intostatistical software as implemented in a package called grImport for the R statistical com-puting environment. This approach assumes that an original image can be transformedinto a PostScript format (i.e., the opriginal image is in a standard vector graphics formatsuch as PostScript, PDF, or SVG). The grImport package consists of three components: afunction for converting PostScript les to an R-specic XML format; a function for read-ing the XML format into special Picture objects in R; and functions for manipulatingand drawing Picture objects. Several examples and applications are presented, includingannotating a statistical plot with an imported logo and using imported images as plottingsymbols.