Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as_sheets_id

Coerce to a sheets_id object


Description

Converts various representations of a Google Sheet into a sheets_id object. Anticipated inputs:

  • Spreadsheet id, "a string containing letters, numbers, and some special characters", typically 44 characters long, in our experience. Example: 1qpyC0XzvTcKT6EISywvqESX3A0MwQoFDE8p-Bll4hps.

  • A URL, from which we can excavate a spreadsheet or file id. Example: "https://docs.google.com/spreadsheets/d/1BzfL0kZUz1TsI5zxJF1WNF01IxvC67FbOJUiiGMZ_mQ/edit#gid=1150108545".

  • A one-row dribble, a "Drive tibble" used by the googledrive package. In general, a dribble can represent several files, one row per file. Since googlesheets4 is not vectorized over spreadsheets, we are only prepared to accept a one-row dribble.

  • Spreadsheet meta data, as returned by, e.g., gs4_get(). Literally, this is an object of class googlesheets4_spreadsheet.

This is a generic function.

Usage

as_sheets_id(x, ...)

Arguments

x

Something that uniquely identifies a Google Sheet: a sheets_id, a drive_id, a URL, a one-row dribble, or a googlesheets4_spreadsheet.

...

Other arguments passed down to methods. (Not used.)

Examples

as_sheets_id("abc")

googlesheets4

Access Google Sheets using the Sheets API V4

v0.3.0
MIT + file LICENSE
Authors
Jennifer Bryan [cre, aut] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.