rvg v0.2.2

0

Monthly downloads

0th

Percentile

R Graphics Devices for Vector Graphics Output

Vector Graphics devices for Microsoft PowerPoint and Excel. Functions extending package 'officer' are provided to embed 'DrawingML' graphics into 'Microsoft PowerPoint' presentations and 'Microsoft Excel' workbooks.

Readme

rvg package

Travis-CI Build
Status Build
status version cranlogs Active

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).

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.

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. For more details, read officer article graphics.

Installation

You can get the development version from GitHub:

devtools::install_github("davidgohel/rvg")

Install the CRAN version:

install.packages("rvg")

Functions in rvg

Name Description
ph_with.dml add a plot output as vector graphics into a PowerPoint object
dml_pptx DrawingML graphic device for Microsoft PowerPoint
body_add_vg add a plot output as vector graphics into a Word object
xl_add_vg add a plot output as vector graphics into an Excel object
dml Wrap plot instructions for DrawingML plotting in Powerpoint
dml_xlsx DrawingML graphic device for Microsoft Excel
ph_with_vg add a plot output as vector graphics into a PowerPoint object
dml_docx DrawingML graphic device for Microsoft Word
No Results!

Vignettes of rvg

Name
overview.Rmd
No Results!

Last month downloads

Details

Type Package
License GPL-3
Encoding UTF-8
LinkingTo Rcpp, gdtools
URL https://github.com/davidgohel/rvg
BugReports https://github.com/davidgohel/rvg/issues
RoxygenNote 6.1.1
VignetteBuilder knitr
NeedsCompilation yes
Packaged 2019-11-11 19:23:52 UTC; davidgohel
Repository CRAN
Date/Publication 2019-11-11 20:10:02 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/rvg)](http://www.rdocumentation.org/packages/rvg)