Skip to content

Instantly share code, notes, and snippets.

@PaulC91
Last active June 12, 2018 10:42
Show Gist options
  • Save PaulC91/c5d4eba079006e9e69ba0714378fb6b9 to your computer and use it in GitHub Desktop.
Save PaulC91/c5d4eba079006e9e69ba0714378fb6b9 to your computer and use it in GitHub Desktop.
googlesheets setup for shiny
library(googlesheets)
# do this initially to save your token in the app's working direcotory
# once it's saved you can comment this code out
token <- gs_auth(cache = FALSE)
saveRDS(token, file = "googlesheets_shiny_token.rds")
# then this code in your app will authenticate and read in a workbook of your choice each time it's loaded
gs_auth(token = "googlesheets_shiny_token.rds")
sheet_key <- "your_google_sheet_key_here"
df <- gs_key(sheet_key) %>%
gs_read_csv(ws = "worksheet_to_read")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment