jennybc / googlesheets

Google Spreadsheets R API
Other
783 stars 191 forks source link

Making Non-Interactive calls on google sheets in R #375

Closed simeonrox closed 5 years ago

simeonrox commented 5 years ago

Hi,

I'm not going to lie, I am a newbie to R. However I have just developed a script that checks certain commodity prices and the updates a google spreadsheet every evening. I have set up the BAT file in order to do this, however I am having difficulties in storing and referring to my google sheets token so the api connection is also non interactive.

1) Where and how do I store and refer to the token. All the forums refer to an ,rds file but what goes into the .rds file and how do I refer to it in the main script ?

jennybc commented 5 years ago

The topic of non-interactive use is covered in this vignette:

https://cran.r-project.org/web/packages/googlesheets/vignettes/managing-auth-tokens.html

Just so you know, googlesheets (this package) is being sunsetted very soon, in favour of a successor googlesheets4:

https://github.com/tidyverse/googlesheets4

Also, depending on what you're doing, a great deal of googlesheets's functionality (this package) can be accomplished with the already-released and actively-maintained googledrive package:

https://googledrive.tidyverse.org

Anything that operates at the whole file level can be done with googledrive and, even here, has always involved calls to the Drive API instead of Sheets.

So, in terms of developing your workflow, I recommend you look towards those packages as dependencies and not googlesheets.