smithjd / Rfunctions

R function library
GNU General Public License v2.0
0 stars 1 forks source link

Your googlesheets set up #1

Open jennybc opened 9 years ago

jennybc commented 9 years ago

Thanks for sharing this example of how you use googlesheets! And the interesting blog post that lead me here.

In setup_my_google.R, I gather you want to use your own client secret and id, instead of the ones that ship w/ the package? But it doesn't look like the google_token object will be used in upload_google_ss() and, therefore, gs_upload(). I suspect that code, as it is now, has no affect on your calls to the Sheets API. I'd be curious if I am missing something. I think you need to use an explicit call to gs_auth(), which has arguments for client secret and id, to accomplish what you want, i.e. get into an authorized state w/ YOUR client secret and id.

You may have reasons for using gs_upload() but just wanted to point out: You can use gs_new() to go straight from a data.frame to a new Google Sheet, without creating and then deleting a local csv. Or gs_ws_new() to go from data.frame to a new worksheet within an existing Google Sheet.

I like the way you are naming the new Google Sheet based on the data.frame's name. I probably should do that by default!

smithjd commented 9 years ago

Wow! Will study your suggestions. (I rather doubt you're missing something... :-)

Will experiment with gs_new().

I find that in general naming things (like Google Spreadsheets) makes a big difference in the handoff project I'm undertaking.