tanaylab / tgppt

Tanay Group Powerpoint Utils

Home Page:https://tanaylab.github.io/tgppt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tgppt

CRAN status Codecov test coverage

The goal of tgppt is to provide handy functions to plot directly to Powerpoint in R. It is based on the magnificent officer package by David Gohel.

Installation

You can install tgppt with:

remotes::install_github("tanaylab/tgppt")

Example

Plot base R directly to a Powerpoint presentation:

library(tgppt)
temp_ppt <- tempfile(fileext = ".pptx")
plot_base_ppt({plot(mtcars$mpg, mtcars$drat)}, temp_ppt)

Plot ggplot to a Powerpoint presentation:

library(tgppt)
library(ggplot2)
gg <- ggplot(mtcars, aes(x=mpg, y=drat)) + geom_point()
temp_ppt <- tempfile(fileext = ".pptx")
plot_gg_ppt(gg, temp_ppt)

Create a new Powerpoint file:

library(tgppt)
new_ppt("myfile.pptx")

Use “Arial” font based ggplot theme:

ggplot2::theme_set(theme_arial(8))

rasterize ggplot plotting area

Powerpoint might crash when plotting a large number of points. To avoid that, set rasterize_plot to TRUE:

plot_gg_ppt(gg, temp_ppt, rasterize_plot = TRUE)

About

Tanay Group Powerpoint Utils

https://tanaylab.github.io/tgppt

License:Other


Languages

Language:R 100.0%