How to upload to Google Drive from R

Asked

Viewed 91 times

1

I was watching about the googledrive package from R’s CRAN and I’m not getting it to work, how to get it into my account. My goal is to upgrade a data frame and as CSV, direct to my account.

  • Boas Márccio. It’s not an answer to your request, but take a look at these two links with an example that might help you with the package googledrive code if you haven’t seen it. https://daattali.com/shiny/persistent-data-storage/ https://deanattali.com/blog/shiny-persistent-data-storage/#gsheets In these links you are following a similar method to the one you used to connect the Dropbox https://github.com/karthik/rdrop2#accessing-Dropbox-on-Shiny-and-remote-It’s not the answer, but it seems to me that maybe it would help and be timely.

1 answer

1


Hello! Just do the following:

library(googledrive)
write.csv(mtcars, file = "dados.cars.csv") # Arquivo de exemplo para fazer o upload
googledrive::drive_upload(media = "/seu.diretorio/dados.cars.csv", 
                          path = "nome.do.arquivo.para.aparecer.no.drive.csv")

If you put type = spreadsheet your file turns into a spreadsheet.

When making the first upload, you will have to give permission from the googledrive. The function drive_update updates the file type or the file type.

Documentation Google drive

Browser other questions tagged

You are not signed in. Login or sign up in order to post.