Lucy D’Agostino McGowan 5/3/2017
This is a little demo to show how we may view sharing.
library('dplyr')
library('googledrive')
drive_auth("drive-token.rds")
write.table("This is a little demo", "demo.txt")
drive_upload("demo.txt", "Happy Little Demo")
## File uploaded to Google Drive:
## demo.txt
## As the Google text/plain named:
## Happy Little Demo
my_file <- drive_list("Happy Little Demo")$id %>%
drive_file()
my_file
## File name: Happy Little Demo
## File owner: tidyverse testdrive
## File type: text/plain
## Last modified: 2017-05-22
## Access: Shared with specific people.
cool beans - it's private!
all functions that will somehow change the file will output a new file, overwrite the old file with this to avoid confusion
my_file<- my_file %>%
drive_share(role = "reader", type = "anyone")
## The permissions for file 'Happy Little Demo' have been updated
Let's see what that did
my_file
## File name: Happy Little Demo
## File owner: tidyverse testdrive
## File type: text/plain
## Last modified: 2017-05-22
## Access: Anyone who has the link can access. No sign-in required.
Now anyone with the link can view it
my_file <- my_file %>%
drive_share(role = "reader", type = "anyone", allowFileDiscovery = "true")
## The permissions for file 'Happy Little Demo' have been updated
Let's see what that did
my_file
## File name: Happy Little Demo
## File owner: tidyverse testdrive
## File type: text/plain
## Last modified: 2017-05-22
## Access: Anyone on the internet can find and access. No sign-in required.
I've added access
to the Google Drive file object
my_file$access
## [1] "Anyone on the internet can find and access. No sign-in required."
you can also output a link to share
drive_share_link(my_file)
## [1] "https://drive.google.com/file/d/0B0Gh-SuuA2nTNHFSM05ycjhwRVE/view?usp=drivesdk"
drive_delete(my_file)
## The file 'Happy Little Demo' has been deleted from your Google Drive
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.