Let’s crack on with an example.
First, install the software:
We then need an example sheet to work with, and I’m going to use one from Britain Elects:
— Britain Elects (@britainelects) August 19, 2016
So go here and add this to your own collection (yes you’ll need a google account!) using the little “Add to my drive” icon to the right of the title, just next to the star.
Right, let’s play around a bit!
# load package library(googlesheets) # which google sheets do you have access to? # may ask you to authenticate in a browser! gs_ls() # get the Britain Elects google sheet be
This should show you all of the sheets you have access to, and also select the one we want.
Now we can see which worksheets exist within the sheet:
# list worksheets gs_ws_ls(be)
We can “download” one of the sheets using gs_read()
# get Westminster voting west
And hey presto, we have the data. Simples!
Now let’s plot it:
# reverse so that data are forward-sorted by time wdf