googlesheets4 ships with static IDs for some world-readable example Sheets for use in examples and documentation. These functions make them easy to access by their nicknames.

gs4_example(matches)

gs4_examples(matches)

Arguments

matches

A regular expression that matches the nickname of the desired example Sheet(s). This argument is optional for gs4_examples() and, if provided, multiple matches are allowed. gs4_example() requires this argument and requires that there is exactly one match.

Value

  • gs4_example(): a single sheets_id object

  • gs4_examples(): a named vector of all built-in examples, with class drive_id

Examples

gs4_examples()
#> mini-gap #> "1k94ZVVl6sdj0AXfK9MQOuQ4rOhd1PULqpAu2_kr9MAU" #> gapminder #> "1U6Cf_qEOhiR9AZqTqS3mbMF3zt2db48ZP5v3rkrAEJY" #> deaths #> "1VTJjWoP1nshbyxmL9JqXgdVsimaYty21LGxxs018H2Y" #> chicken-sheet #> "1ct9t1Efv8pAGN9YO5gC2QfRq2wT4XjNoTMXpVeUghJU" #> formulas-and-formats #> "1wPLrWOxxEjp3T1nv2YBxn63FX70Mz5W5Tm4tGc-lRms" #> cell-contents-and-formats #> "1peJXEeAp5Qt3ENoTvkhvenQ36N3kLyq6sq9Dh2ufQ6E" #> attr(,"class") #> [1] "drive_id"
gs4_examples("gap")
#> mini-gap #> "1k94ZVVl6sdj0AXfK9MQOuQ4rOhd1PULqpAu2_kr9MAU" #> gapminder #> "1U6Cf_qEOhiR9AZqTqS3mbMF3zt2db48ZP5v3rkrAEJY" #> attr(,"class") #> [1] "drive_id"
gs4_example("gapminder")
#> Spreadsheet name: <unknown> #> ID: 1U6Cf_qEOhiR9AZqTqS3mbMF3zt2db48ZP5v3rkrAEJY #> Locale: <unknown> #> Time zone: <unknown> #> # of sheets: <unknown> #> #> Unable to get metadata for this Sheet. Error details: #> Can't get Google credentials. #> Are you running googlesheets4 in a non-interactive session? Consider: #> * `gs4_deauth()` to prevent the attempt to get credentials. #> * Call `gs4_auth()` directly with all necessary specifics. #> See gargle's "Non-interactive auth" vignette for more details: #> https://gargle.r-lib.org/articles/non-interactive-auth.html