drive_reveal() adds extra information about your Drive files that is not
readily available in the default
dribble produced by googledrive. Why is
this info not always included in the default
You don't always care about it. There is a lot of esoteric information in
drive_resource that has little value for most users.
It might be "expensive" to get this information and put it into a usable
form. For example, revealing a file's
"published" status all require additional API calls.
drive_reveal() can also hoist any property out of the
list-column, when the property's name is passed as the
what argument. The
resulting new column is simplified if it is easy to do so, e.g., if the
individual elements are all string or logical. If
what extracts a
date-time, we return
POSIXct. Otherwise, you'll get a
list-column. If this makes you sad, consider using
It is more powerful due to a richer "plucking specification" and its
transform arguments. Another useful function is
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
Character, describing the type of info you want to add. These values get special handling (more details below):
You can also request any property in the
An object of class
dribble, a tibble with one row per file.
The additional info requested via
appears in one (or more) extra columns.
what = "path" the
dribble gains a character
column holding each file's path. This can be very slow, so use with
The example path
~/a/b/ illustrates two conventions used in googledrive:
~/ means that the folder
a is located in the current
user's "My Drive" root folder.
/ means that
b, located in
a, is a folder or a folder
what = "permissions" the
dribble gains a logical column
that indicates whether a file is shared and a new list-column
permissions_resource containing lists of
what = "published" the
dribble gains a logical column
published that indicates whether a file is published and a new list-column
revision_resource containing lists of
what = "parent" the
dribble gains a character column
that is the file id of this item's parent folder. This information is
available in the
drive_resource, but can't just be hoisted out:
Google Drive used to allow files to have multiple parents, but this is no longer supported and googledrive now assumes this is impossible. However, we have seen (very old) files that still have >1 parent folder. If we see this we message about it and drop all but the first parent.
parents property in
drive_resource has an "extra" layer of nesting
and needs to be flattened.
If you really want the raw
parents property, call
drive_reveal(what = "parents").
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# Get a few of your files files <- drive_find(n_max = 10, trashed = NA) # the "special" cases that require additional API calls and can be slow drive_reveal(files, "path") drive_reveal(files, "permissions") drive_reveal(files, "published") # a "special" case of digging info out of `drive_resource`, then processing # a bit drive_reveal(files, "parent") # the "simple" cases of digging info out of `drive_resource` drive_reveal(files, "trashed") drive_reveal(files, "mime_type") drive_reveal(files, "starred") drive_reveal(files, "description") drive_reveal(files, "version") drive_reveal(files, "web_view_link") drive_reveal(files, "modified_time") drive_reveal(files, "created_time") drive_reveal(files, "owned_by_me") drive_reveal(files, "size") drive_reveal(files, "quota_bytes_used") # 'root' is a special file id that represents your My Drive root folder drive_get(id = "root") %>% drive_reveal("path")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.