side note, really excited to include emojis in a non-hacky way, thanks emo::ji r emo::ji("sunflower")
library('googledrive') library('dplyr') drive_auth("drive-token.rds")
drive_list()
pulls out name, type, & id
drive_list()
We can search using regular expressions
drive_list(pattern = "test")
We can also pass additional query parameters through the ...
, for example
drive_list(pattern = "test", orderBy = "modifiedTime")
Note: now it seems we have to specify the fields (in v2 where I was working previously, it would automatically output everything, see this).
List of all fields here.
Now let's say I want to dive deeper into the top one
id <- drive_list("test")$id[1] file <- drive_file(id) file
In addition to the things I've pulled out, there is a tibble
of permissions as well as a list
(now named kitchen_sink
, this should change), that contains all output fields.
file$permissions
str(file$kitchen_sink)
drive_user()
write.table("this is a test", file = "~/desktop/test.txt") drive_upload(from = "~/desktop/test.txt", up_name = "This is a test", overwrite = TRUE)
file <- drive_file(drive_list("This is a test")$id) file
file <- drive_share(file, role = "writer", type = "user", emailAddress = "dagostino.mcgowan.stats@gmail.com",emailMessage = "I am sharing this cool file with you. Now you can write. You are welcome." )
file$permissions %>% select(displayName,role, type)
file <- drive_share(file, role = "reader", type = "anyone", allowFileDiscovery = "true")
drive_share_link(file)
this looks exactly the same as the share link from the Google Drive GUI except usp=drivesdk
instead of usp=sharing
drive_delete(file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.