Reputation: 26437
I want to access a Google Spreadsheet via R. As I'm using my Google Account for a lot of things and sometimes do share code I'm not comfortable with storing the password for my Google Account in a script file.
What the best way to handle this login issue. Is there some way to create a token that R can use to login to Google docs that only works for google docs? Otherwise how do I deal with the issue? If it matters I use KeePass as my general password manager.
Upvotes: 0
Views: 172
Reputation: 368629
One common trick is to store it in an environment variable. Nothing gets written to disk, and you can query it in R via
Sys.getenv("NAMEOFMYVAR")
where NAMEOFMYVAR
is the handle you use.
The downside is that this does not work for scripting. For that you need to eventually write something down somewhere...
Edit: There is also an API as a quick Google search reveals...
Upvotes: 2