Skip to content

Instantly share code, notes, and snippets.

@stephlocke
Last active July 20, 2017 14:17
Show Gist options
  • Save stephlocke/1a336ccae5e327e1ea8cf853973edb46 to your computer and use it in GitHub Desktop.
Save stephlocke/1a336ccae5e327e1ea8cf853973edb46 to your computer and use it in GitHub Desktop.
Example of reading all tabs in a google spreadsheet
library(googlesheets)
library(purrr)
library(data.table)
library(magrittr)
suppressMessages(gs_auth(token = "c:\\Users/steph/Documents/googlesheets_token.rds", verbose = FALSE))
mySheet<-"https://docs.google.com/spreadsheets/d/1QfvTK58YO7kBIzI81JQ7rNLcTVbH0hDiP6qZ724GyoA/edit?usp=sharing"
mySheet %>%
gs_url() %>%
gs_ws_ls() %>%
map(~gs_read(gs_url(mySheet),ws=.)) %>%
rbindlist(use.names = TRUE, fill=TRUE) ->
surveyresults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment