googlesheet: Register a Google Sheet

Description Usage Arguments Details Value

View source: R/googlesheet.R

Description

The googlesheets package must gather information on a Google Sheet from the API prior to any requests to read or write data. We call this registering the sheet and store the result in a googlesheet object. Note this object does not contain any sheet data, but rather contains metadata about the sheet. We populate a googlesheet object with information from the worksheets feed and, if available, also from the spreadsheets feed. Choose from the functions below depending on the type of sheet-identifying input you will provide. Is it a sheet title, key, browser URL, or worksheets feed (another URL, mostly used internally)?

Usage

1
2
3
4
5
6
7
8
9
gs_title(x, verbose = TRUE)

gs_key(x, lookup = NULL, visibility = NULL, verbose = TRUE)

gs_url(x, lookup = NULL, visibility = NULL, verbose = TRUE)

gs_ws_feed(x, lookup = NULL, verbose = TRUE)

gs_gs(x, visibility = NULL, verbose = TRUE)

Arguments

x

sheet-identifying information; a character vector of length one holding sheet title, key, browser URL or worksheets feed OR, in the case of gs_gs only, a googlesheet object

verbose

logical; do you want informative messages?

lookup

logical, optional. Controls whether googlesheets will place authorized API requests during registration. If unspecified, will be set to TRUE if authorization has previously been used in this R session, if working directory contains a file named .httr-oauth, or if x is a worksheets feed or googlesheet object that specifies "public" visibility.

visibility

character, either "public" or "private". Consulted during explicit construction of a worksheets feed from a key, which happens only when lookup = FALSE and googlesheets is prevented from looking up information in the spreadsheets feed. If unspecified, will be set to "public" if lookup = FALSE and "private" if lookup = TRUE. Consult the API docs for more info about visibility

Details

A registered googlesheet will contain information on:

A googlesheet object will contain this information from the spreadsheets feed if it was available at the time of registration:

Since the spreadsheets feed contains private user data, googlesheets must be properly authorized to access it. So a googlesheet object will only contain info from the spreadsheets feed if lookup = TRUE, which directs us to look up sheet-identifying information in the spreadsheets feed.

Value

a googlesheet object


jennybc/googlesheets documentation built on Feb. 8, 2022, 11:48 p.m.