Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidgohel/rvg
https://github.com/davidgohel/rvg
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/davidgohel/rvg
- Owner: davidgohel
- Created: 2015-08-10T08:22:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T07:20:55.000Z (about 1 month ago)
- Last Synced: 2024-11-01T08:20:33.923Z (about 1 month ago)
- Language: R
- Homepage: https://davidgohel.github.io/rvg/
- Size: 801 KB
- Stars: 131
- Watchers: 15
- Forks: 15
- Open Issues: 10
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
Awesome Lists containing this project
- jimsghstars - davidgohel/rvg - (R)
README
---
title: "rvg package"
output:
github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
message = FALSE,
collapse = TRUE,
comment = "#>"
)
```[![R-CMD-check](https://github.com/davidgohel/rvg/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/davidgohel/rvg/actions/workflows/R-CMD-check.yaml)
[![version](https://www.r-pkg.org/badges/version/rvg)](https://CRAN.R-project.org/package=rvg)
![cranlogs](https://cranlogs.r-pkg.org/badges/rvg)`rvg` is providing two graphics devices that produces Vector Graphics outputs in
DrawingML format for Microsoft PowerPoint with `dml_pptx` and for Microsoft Excel
with `dml_xlsx`. Theses formats let users edit the graphic elements (*editable
graphics*) within PowerPoint or Excel and have a very good rendering.These raw XML outputs cannot be used *as is*. Functions `dml` and `ph_with()`
have to be used with package `officer` to add vector graphics
in PowerPoint documents (`dml` function is a simple wrapper to mark
the plot instructions as Vector Graphics instructions).```{r eval=FALSE}
library(rvg)
library(ggplot2)
library(officer)my_vec_graph <- dml(code = barplot(1:5, col = 2:6))
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(doc, my_vec_graph, location = ph_location_fullsize() )
print(doc, target = "my_plot.pptx")
```Function `xl_add_vg()` is the equivalent for Excel workbooks.
```{r eval=FALSE}
doc <- read_xlsx()
doc <- xl_add_vg(doc, sheet = "Feuil1", code = print(gg),
width = 6, height = 6, left = 1, top = 2 )
print(doc, target = "vg.xlsx")
```By default, theses graphics are *editable*, element edition can be disabled
with option `editable = FALSE`.## Installation
You can get the development version from GitHub:
```{r eval=FALSE}
devtools::install_github("davidgohel/rvg")
```Install the CRAN version:
```{r eval=FALSE}
install.packages("rvg")
```