Skip to contents

Converts table to an r2slides_table (if it isn't one already), builds the necessary batchUpdate requests, and submits them in order to the Slides API.

Usage

add_table(
  slide_obj,
  table,
  position,
  order = c("front", "back"),
  table_id = NULL,
  replacement_strategy = get_replacement_strategy(),
  match_fn = get_match_fn()
)

Arguments

slide_obj

A r2slides::slide object.

table

An r2slides_table, or any object for which an as_r2slides_table() method exists (e.g. a flextable).

position

A slide_position describing where to place the table.

order

One of "front" or "back". Controls the Z-order of the created element. Default: "front".

table_id

Optional character string. Object ID to assign to the new table. Auto-generated when NULL.

replacement_strategy

One of "add" (default), "replace", or "skip". Overrides the package-wide default set by set_replacement_strategy(). "add" always creates a new element. "replace" deletes any matching element and creates a fresh one. "skip" leaves a matching element untouched and suppresses creation.

match_fn

A function that identifies an existing slide element matching the new one. Must have signature function(new_spec, existing_elements) -> character(1) | NULL. See match_by_type_and_position() for details and the built-in implementation. Overrides the package-wide default set by set_match_fn().

Value

The slide_obj (invisibly).