Skip to contents

An R6 class to represent and manipulate Google Slides presentations.

Public fields

title

The title of the presentation

presentation_id

The Google Slides presentation ID

page_size

Dimensions of slides (height and width in PTs)

revision_id

The current revision ID from Google Drive

locale

The presentation locale (e.g., "en")

masters

List of master slide metadata

layouts

List of layout slide metadata

last_refreshed

Timestamp of last refresh from API

Methods


Method new()

Create or open a presentation

Usage

presentation$new(id = NULL, title = "Untitled Presentation", set_active = TRUE)

Arguments

id

Presentation ID, URL, name, or NULL to create new

title

Title for new presentation (only used if id is NULL)

set_active

Whether to make this the active presentation

Returns

A new `presentation` object


Method refresh()

Refresh presentation data from Google Slides API

Usage

presentation$refresh()

Returns

Self, invisibly (for method chaining)


Method delete()

Delete the presentation from Google Drive

Usage

presentation$delete()

Arguments

permanent

Whether to permanently delete (TRUE) or move to trash (FALSE)

Returns

NULL, invisibly


Method copy()

Create a copy of the presentation

Usage

presentation$copy(name = NULL)

Arguments

name

Name for the copy (defaults to "Copy of original_name")

Returns

A new presentation object for the copy


Method get_slide_by_index()

Get slide object from the presentation

Usage

presentation$get_slide_by_index(index)

Arguments

index

Index of the slide to return (1-based)

Returns

A slide object


Method get_slide_by_id()

Get slide object from the presentation

Usage

presentation$get_slide_by_id(slide_id)

Arguments

slide_id

ID of the slide to return

Returns

A slide object


Method get_slide_index()

Get the position of a slide in the presentation

Usage

presentation$get_slide_index(slide)

Arguments

slide

A slide object

Returns

Index of the slide


Method get_slide_ids()

Get slide IDs from the presentation

Usage

presentation$get_slide_ids()

Returns

Character vector of slide object IDs


Method set_active()

Set this presentation as the active one

Usage

presentation$set_active()

Returns

Self, invisibly (for method chaining)


Method set_not_active()

Set this presentation to not active

Usage

presentation$set_not_active()

Returns

Self, invisibly (for method chaining)


Method is_active()

Check if this is the active presentation

Usage

presentation$is_active()

Returns

Logical


Method get_url()

Get the Google Slides URL for this presentation

Usage

presentation$get_url()

Returns

Character URL or NULL


Method browse()

Open the presentation in a browser

Usage

presentation$browse()

Returns

Self, invisibly (for method chaining) Get elements from the presentation


Method get_elements()

Filter the elements you have constructed to return a list of elements

Usage

presentation$get_elements(
  modified_since = NULL,
  modified_end = NULL,
  created_since = NULL,
  created_end = NULL,
  element_type = NULL,
  element_text = NULL,
  show_deleted = FALSE
)

Arguments

modified_since

Optional. Only return elements modified since this time

modified_end

Optional. Only return elements modified before this time

created_since

Optional. Only return elements created since this time

created_end

Optional. Only return elements created before this time

element_type

Optional. Only return elements of this type

element_text

Optional. Only return elements with this text

show_deleted

Optional. Show deleted elements

Returns

List of elements


Method add_to_ledger()

Add an element to the ledger

Usage

presentation$add_to_ledger(element_id, slide_id, element_type, element_text)

Arguments

element_id

Element ID

slide_id

Slide ID

element_type

Element type

element_text

Element text

Returns

Self


Method print()

Print method for presentation objects

Usage

presentation$print(...)

Arguments

...

Additional arguments (unused)