Untitled

knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)
library(ggplot2)
library(rvg)

Table

head(cars)
head(iris)

Slide with Plot

dml(plot(pressure))

Slide with ggplot

mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)

Slide with ggplot

mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)

ggplot in left column

mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)

ggplot in right column

mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)

ggplot in both columns

dml(ggobj = mygg)
dml(ggobj = mygg)

custom plot locations

dml(plot(pressure))
dml(plot(pressure))

Non-editable plot

dml(plot(pressure), editable = FALSE)

officer block list

library(officer)
fpt_blue_bold <- fp_text_lite(color = "#006699", bold = TRUE)
fpt_red_italic <- fp_text_lite(color = "#C32900", italic = TRUE)
value <- block_list(
  fpar(ftext("hello world", fpt_blue_bold)),
  fpar(ftext("hello", fpt_blue_bold), " ",
       ftext("world", fpt_red_italic))
)
value


Try the officedown package in your browser

Any scripts or data that you put into this service are public.

officedown documentation built on Sept. 3, 2023, 1:07 a.m.