Last active
June 12, 2018 10:42
-
-
Save PaulC91/c5d4eba079006e9e69ba0714378fb6b9 to your computer and use it in GitHub Desktop.
googlesheets setup for shiny
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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