gs_slide_df: Get Google Slide Elements IDs

Description Usage Arguments Value Examples

View source: R/gs_slide_df.R

Description

Get Google Slide Elements IDs

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
gs_slide_df(id, extract_code = TRUE, use_google_drive = FALSE, ...)

notes_from_slide(id)

gs_notes_from_slide(id)

notes_from_slide_output(slides)

gs_get_slides(id)

gs_speaker_notes_id(id)

gs_replace_notes(id, notes)

Arguments

id

Slide id passed to get_slides_properties after passing through as_id

extract_code

If you have text with #rstats in the slide or #rstats in the Alt-text title, code will be included

use_google_drive

Use Google Drive to host the PNGs, calling gs_to_drive_pngs

...

additional arguments to pass to gs_to_drive_pngs

slides

an output of gs_slide_df(id)

notes

a character vector of notes to be added to the slides

Value

A data.frame of the identifiers and properties of the slides

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## Not run: 
id = "1XoRj0pwaLI34XKZ7TljVeDHu-tbgGmXRmQa528JIwmw"
slides = gs_slide_df(id)
all_notes = notes_from_slide(id)
slides$slideProperties$notesPage$pageElements[[1]]
pe = slides$slideProperties$notesPage$pageElements
text = pe[[1]]$shape$text$textElements[[2]]$textRun$content
notes = sapply(pe,
function(r) {
res = sapply(r$shape$text$textElements, function(x) x$textRun$content)
res = unlist(res)
res = res[!is.na(res)]
if (is.null(res)) {
res = ""
}
paste(res, collapse = " ")
})
notes

## End(Not run)
## Not run: 
id = "1XoRj0pwaLI34XKZ7TljVeDHu-tbgGmXRmQa528JIwmw"
slides = gs_get_slides(id)
tfile = tempfile(fileext = ".txt")
writeLines(slides$content, con = tfile)
ss = strsplit(slides$content, split = "\n")[[1]]
ind = grep("uthinkk", ss)
ss[(ind -30):(ind + 5)]

slides$parsed$slides$slideProperties$notesPage
slides$parsed$slides$slideProperties$notesPage$pageElements



## End(Not run)
## Not run: 
id = "1XoRj0pwaLI34XKZ7TljVeDHu-tbgGmXRmQa528JIwmw"
parsed = gs_get_slides(id)$parsed
parsed$slides$slideProperties$notesPage$notesProperties$speakerNotesObjectId

notes_id = gs_speaker_notes_id(id)


## End(Not run)
## Not run: 

id = "1XoRj0pwaLI34XKZ7TljVeDHu-tbgGmXRmQa528JIwmw"
shape_ids = gs_speaker_notes_id(id)
notes = sample(letters, size = length(shape_ids))
res = gs_replace_notes(id, notes)
curr_notes = notes_from_slide(id)
all(curr_notes == notes)

## End(Not run)

muschellij2/didactr documentation built on March 17, 2021, 12:45 p.m.