https://github.com/richfitz/vector
Vector image utilities for R
https://github.com/richfitz/vector
Last synced: over 1 year ago
JSON representation
Vector image utilities for R
- Host: GitHub
- URL: https://github.com/richfitz/vector
- Owner: richfitz
- License: other
- Created: 2014-06-12T01:14:33.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-13T00:57:08.000Z (about 12 years ago)
- Last Synced: 2025-01-20T22:53:52.444Z (over 1 year ago)
- Language: R
- Size: 160 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vectoR
======
[](https://travis-ci.org/richfitz/vectoR)
Some simple utilities for working with vector images.
## Installation
With devtools installed
```
devtools::install_github("richfitz/vectoR")
```
## Why is this package needed?
The `grImport` package can draw vector images on R plots! This is fantastic! But doing so is a pain:
1. Convert the your SVG figure to EPS by opening in Inkscape or Illustrator and save as an eps
2. Convert the EPS to XML by running through ghostscriptrepresentation
3. Read the XML into R with `readPicture`
Plus, some of these steps are relatively time consuming, given that the results are deterministic.
The function `vector_read` is a high-level wrapper to this function. It still requires Inkscape and ghostscript to be installed, but it will try to do the conversions with as few steps as possible. So if the XML file is already there it will read that, if not it looks for the EPS to generate the XML from and if that's not there does the full SVG to EPS to XML conversion. It saves output with predictable names so that future uses are faster.
This package is deliberately extremely simple. It might be easiest (especially given the package is not on CRAN and may never go on CRAN) to directly include the source files `R/vector_read.R` and `R/util.R` in your project. If you do that, you probably will want to comment the `##' @export` roxygen tags and/or rename the functions to avoid conflicts.