1

I'm trying to write a data frame consisting 1100 rows and 5 columns from R to GoogleSheets using library(googlesheets) but it is taking forever to do so and sometimes returns Error in function_list[[k]](value) : Bad Gateway (HTTP 502).
How to solve this error?
Is there any other more efficient method?

What I'm doing:

worksheet<-gs_new(title = "worksheet",row_extent = 2000, col_extent = 10) sheetX<-worksheet%>% gs_ws_new(ws_title="sheetX",input=df)

I've also tried concatenating the columns before uploading. Even that takes a lot of time.

I'm planning to schedule this code every week. Is there any way to update data in this sheet or will it make a new sheet everytime?
Thanks in advance!

  • Sometimes your code will run faster than the Google API can keep up with. Other times you might get a 502 error because of an issue with Google Servers themselves. I recommend adding `Sys.sleep(5)` in between the creation of the workbook using `gs_new` and then populating it. – Steven M. Mortimer Jun 13 '17 at 01:10

0 Answers0