Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R: googlesheets/gs_upload: Upload to a specific folder

Using the googlesheets package, I am trying to upload a csv to a specific folder in GDrive.

Example:

## Not run: 
write.csv(head(iris, 5), "iris.csv", row.names = FALSE)
gs_upload("iris.csv")

The above will upload the file to my home directory but I need the file to be in a specific directory because I want to create multiple files and be able to share the entire directory.

Alternatively, if there's a way to programmatically move the file after creation, that would be fine too.

like image 496
user3683575 Avatar asked Nov 10 '15 14:11

user3683575


1 Answers

You can use the googledrive package to move the file once it's created:

library(googledrive)
drive_mkdir("iris_folder")  # make folder in home Drive directory
drive_mv(file = "iris", path = "iris_folder/")  # move Sheets file
like image 80
David Rubinger Avatar answered Oct 05 '22 21:10

David Rubinger