# NOT RUN {
## get info about your "My Drive" root folder
drive_get("~/")
## the API reserves the file id "root" for your root folder
drive_get(id = "root")
drive_get(id = "root") %>% drive_reveal("path")
## The examples below are indicative of correct syntax.
## But note these will generally result in an error or a
## 0-row dribble, unless you replace the inputs with paths
## or file ids that exist in your Drive.
## multiple names
drive_get(c("abc", "def"))
## multiple names, one of which must be a folder
drive_get(c("abc", "def/"))
## query by file id(s)
drive_get(id = "abcdefgeh123456789")
drive_get(as_id("abcdefgeh123456789"))
drive_get(id = c("abcdefgh123456789", "jklmnopq123456789"))
## apply to a browser URL for, e.g., a Google Sheet
my_url <- "https://docs.google.com/spreadsheets/d/FILE_ID/edit#gid=SHEET_ID"
drive_get(my_url)
drive_get(as_id(my_url))
drive_get(id = my_url)
## access the Team Drive named "foo"
## team_drive params must be specified if getting by path
foo <- team_drive_get("foo")
drive_get(c("this.jpg", "that-file"), team_drive = foo)
## team_drive params are not necessary if getting by id
drive_get(as_id("123456789"))
## search all Team Drives and other files user has accessed
drive_get(c("this.jpg", "that-file"), corpus = "all")
# }
Run the code above in your browser using DataLab