add_create_shape_request {rgoogleslides}R Documentation

Add a create shape request

Description

This function builds up the request for creating shapes within Googleslides via the API.

Usage

add_create_shape_request(
  google_slides_request = NULL,
  shape_type,
  page_element_property,
  object_id = NULL
)

Arguments

google_slides_request

(Optional) A Google Slides Request object which is used to manage requests to the API

shape_type

A character vector that contains the shape type for the new shape that is to be created

page_element_property

A list that contains a page element property. The page element is to be generated by the page_element_property function in this package. IT IS COMPULSORY TO ADD WIDTH AND HEIGHT AS PART OF THE page_element_property

object_id

(Optional) A character vector to name the object created instead of leaving it to Google

Examples

## Not run: 
library(rgoogleslides)
rgoogleslides::authorize()

# Define the presentation slide id (Can be retrieved from the url of the slides)
slides_id <- "<slide-id>"

slide_page <- page_element_property("p", 200, 300)
request <- add_create_shape_request(shape_type = "RECTANGLE", page_element_property = slide_page)
commit_to_slides(slides_id, request)

slide_page <- aligned_page_element_property("p", image_height = 200, image_width = 300)
request2 <- add_create_shape_request(shape_type = "STAR_5", page_element_property = slide_page)
commit_to_slides(slides_id, request2)

## End(Not run)

[Package rgoogleslides version 0.3.2 Index]