Experimental lifecycle

Creates an entirely new (spread)Sheet (or, in Excel-speak, workbook). Optionally, you can also provide names and/or data for the initial set of (work)sheets. Any initial data provided via sheets is styled as a table, as described in sheets_write().

sheets_create(name = sheets_random(), ..., sheets = NULL)

Arguments

name

The name of the new spreadsheet.

...

Optional spreadsheet properties that can be set through this API endpoint, such as locale and time zone.

sheets

Optional input for initializing (work)sheets. If unspecified, the Sheets API automatically creates an empty "Sheet1". You can provide a vector of sheet names, a data frame, or a (possibly named) list of data frames. See the examples.

Value

The input ss, as an instance of sheets_id

See also

Examples

if (sheets_has_token()) { sheets_create("sheets-create-demo-1") sheets_create("sheets-create-demo-2", locale = "en_CA") sheets_create( "sheets-create-demo-3", locale = "fr_FR", timeZone = "Europe/Paris" ) sheets_create( "sheets-create-demo-4", sheets = c("alpha", "beta") ) my_data <- data.frame(x = 1) sheets_create( "sheets-create-demo-5", sheets = my_data ) sheets_create( "sheets-create-demo-6", sheets = list(iris = head(iris), mtcars = head(mtcars)) ) # clean up sheets_find("sheets-create-demo") %>% googledrive::drive_trash() }
#> Creating new Sheet: "sheets-create-demo-1"
#> Creating new Sheet: "sheets-create-demo-2"
#> Creating new Sheet: "sheets-create-demo-3"
#> Creating new Sheet: "sheets-create-demo-4"
#> Creating new Sheet: "sheets-create-demo-5"
#> Creating new Sheet: "sheets-create-demo-6"
#> Files trashed: #> * sheets-create-demo-6: 1OOWJ4PP124-RhxbbnMpqLqhi6YWVmAJJiycY7VwGW-g #> * sheets-create-demo-5: 1dpswJqCgOaP9bUpkdB2qeWjSLk6tChhOcspCj1y9PcU #> * sheets-create-demo-4: 1YqBrI-XZSCvgqy5JzmSrrpLKAoLtJlw7B3aApOQ8Hgg #> * sheets-create-demo-3: 1fZLKyo9t7p25G3Oept5t7MD6Yl-7HdUVOYyokRNLkWc #> * sheets-create-demo-2: 1atC9tZOkKr0pyf6ybu9BHmnIhdpFU-pv9hZW8QT5GME #> * sheets-create-demo-1: 1N5En4MKux-UwN87wNl7H-Jb4PRoLyU_JCDHABuGtqs8