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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With