Learn R Programming

officer (version 0.6.7)

as.matrix.rpptx: PowerPoint table to matrix

Description

Convert the data in an a 'PowerPoint' table to a matrix or all data to a list of matrices.

Usage

# S3 method for rpptx
as.matrix(
  x,
  ...,
  slide_id = NA_integer_,
  id = NA_character_,
  span = c(NA_character_, "fill")
)

Value

A matrix with the data, or if slide_id=NULL, a list of matrices

Arguments

x

The rpptx object to convert (as created by officer::read_pptx())

...

Ignored

slide_id

The slide number to load from (NA indicates first slide with a table, NULL indicates all slides and all tables)

id

The table ID to load from (ignored it is.null(slide_id), NA indicates to load the first table from the slide_id)

span

How should col_span/row_span values be handled? NA means to leave the value as NA, and "fill" means to fill matrix cells with the value.

Examples

Run this code
library(officer)
pptx_file <- system.file(package="officer", "doc_examples", "example.pptx")
z <- read_pptx(pptx_file)
as.matrix(z, slide_id = NULL)

Run the code above in your browser using DataLab