Add column(s) with new information
drive_reveal()
adds extra information about your Drive files that is not
automatically present in the default dribble
produced by googledrive. Why
is this info not always present?
You don't always care about it.
It may require calling different endpoints in the Drive API. Example: determining if a file has been "published on the web".
It might require additional API calls. Example: figuring out the path(s) associated with a specific file.
drive_reveal( file, what = c("path", "trashed", "mime_type", "permissions", "published") )
file |
Something that identifies the file(s) of interest on your Google
Drive. Can be a character vector of names/paths, a character vector of file
ids or URLs marked with |
what |
Character, describing the type of info you want to add:
|
An object of class dribble
, a tibble with one row per item.
Note that Google Drive does NOT behave like your local file system:
File and folder names need not be unique, even at a given level of the hierarchy. A single name or file path can be associated with multiple files (or zero or exactly one).
A file can have more than one direct parent. This implies that a single file can be represented by multiple paths.
Bottom line: Do not assume there is a one-to-one relationship between file name or path and a Drive file or folder. This implies the length of the input (i.e. the number of input paths or the number of rows in a dribble) will not necessarily equal the number rows in the output.
When what = "trashed"
, the dribble
gains a logical variable that
indicates whether a file is in the trash.
When what = "mime_type"
, the dribble
gains a
variable of MIME types.
When what = "permissions"
the dribble
gains a logical variable shared
that indicates whether a file is shared and a new list-column
permissions_resource
containing lists of
Permissions resources.
When what = "published"
the dribble
gains a logical variable
published
that indicates whether a file is published and a new list-column
revision_resource
containing lists of
Revisions resources.
## Not run: ## Get a nice, random selection of files files <- drive_find(n_max = 10, trashed = NA) ## Reveal ## * paths (warning: can be slow for many files!) ## * if `trashed` or not ## * MIME type ## * permissions, i.e. sharing status ## * if `published` or not drive_reveal(files, "path") drive_reveal(files, "trashed") drive_reveal(files, "mime_type") drive_reveal(files, "permissions") drive_reveal(files, "published") ## 'root' is a special file id that always represents your root folder drive_get(id = "root") %>% drive_reveal("path") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.