IQRoutputPPTX: Push contents into a PPTX output

View source: R/slidedeck_classes.R

IQRoutputPPTXR Documentation

Push contents into a PPTX output

Description

The function pushes a plot or table with additional information like title and section into an rds file within a slide folder. From that folder, a slide deck can be generated using the IQSlidedeck() function.

Usage

IQRoutputPPTX(
  ...,
  section = NULL,
  title = NULL,
  layout = NULL,
  filename = NULL,
  outputFolder = NULL,
  verbose = TRUE
)

Arguments

...

The contents to be presented on a slide. Currently supported are one or two objects of type plot or table.

section

character, optional section name. Different section names will generate different subfolders of the slide output folder.

title

character, optional slide title.

layout

character or NULL (default). If NULL, the layout is chosen automatically according to the number of arguments passed via .... List of possible layouts

  • "Title and Content" (one object)

  • "Two Content" (two objects)

  • "Two Content Right Bigger" (two objects, left column smaller than right one)

  • "Title and Content Wide"

filename

character, filename of the rds file.

outputFolder

character or NULL (default). The slide folder where the rds files are saved. By default, slides are saved in the folder getOption("IQSlide.outputfolder").

verbose

logical, if TRUE (default) show verbose information.

Author(s)

Daniel Kaschek, IntiQuan

See Also

Other Slidedeck functions: IQSlidedeck()

Examples

## Not run: 


library(IQRtools)
library(ggplot2)
library(flextable)
setwd(tempdir())

# For compliance information in the footer of the slides
IQRinitCompliance("IQSlidedeck.R")

# ------------------------------------------------------
# Slide 1: Create a plot and a bullet point list
# ------------------------------------------------------

p1 <- IQRggplot(cars, aes(x = speed, y = dist)) + geom_point()
caption(p1) <- "Source: Ezekiel, M. (1930) Methods of Correlation Analysis. Wiley."

IQRoutputPPTX(
  c("Cars data set from R datasets",
    "The data vie the speed of cars and distances taken to stop shown as plot"),
  p1,
  section = "Slides with plots",
  title = "Overview of cars distance vs time to stop",
  filename = "carsPlot"
)


# ------------------------------------------------------
# Slide 2: Create a table and a bullet point list
# ------------------------------------------------------

IQRoutputPPTX(
  info = c("Cars data set from R datasets",
           "The data vie the speed of cars and distances taken to stop"),
  table = IQ_table(cars[1:16,]),
  section = "Slides with tables",
  title = "Overview of cars distance vs time to stop shown as table",
  filename = "carsTable"
)

# ------------------------------------------------------
# Slide 3: Create a table and a formatted bullet point list
# ------------------------------------------------------

IQRoutputPPTX(
  IQ_bullet_list(
    "* Bullet point with **bold** and *italic*" ,
    "* Another bullet point",
    "  * Indented by two spaces",
    "  * Another one",
    "* And back to ***really* outer** level",
    "* Some sort of formula `E_rel_ = m\\*c^2^`"
  ),
  IQ_table(
    cars[1:16,]
  ),
  section = "Slides with tables",
  title = "Overview of cars distance vs time to stop shown as table",
  filename = "carsTable2"
)



# ------------------------------------------------------
# Finally: Create
# ------------------------------------------------------
# Copy-paste the filename shown in R console
# to explorer to open the file

# All slides
IQSlidedeck(
  title = "My first slidedeck with IQSlides",
  subtitle = "Cars and the time they take to stop",
  affiliation = "Daniel Kaschek, IntiQuan",
  date = "2019-11-20"
)


# Just section slides
IQSlidedeck(section = "Slides with plots")


## End(Not run)

IntiQuan/IQSlides documentation built on Jan. 26, 2024, 1 p.m.