(Builds on: Parsing basics)
Use googlesheets by Jenny Bryan to (suprise!) extract data from googlesheets. Sheets is a surprisingly useful way of collaboratively collecting data (especially with google forms); googlesheets makes it easy to get that data into R and make use of it.
If you haven’t already, install it:
install.packages("googlesheets")
library(googlesheets)
Two basic sources of sheets:
https://docs.google.com/spreadsheets/d/1twq7WtX5mor07gR8hjZ0bErOEP8iZJFxD6Q3PUSQ-Z8/pubhtml
gs_url("https://docs.google.com/spreadsheets/d/1twq7WtX5mor07gR8hjZ0bErOEP8iZJFxD6Q3PUSQ-Z8/pubhtml")
gs_read()
Key challenge is identifying the sheet you want:
gs_ls()
gs_ls("Gapminder")
This will create a file called .httr-oauth
in your current directory. NEVER CHECK THIS INTO GIT. (In the RStudio git pane, right-click on it and select ignore, then press OK.)
gs_key()