Guest User

Untitled

a guest
Jun 14th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. library(googlesheets)
  2.  
  3. # do this initially to save your token in the app's working direcotory
  4. # once it's saved you can comment this code out
  5. token <- gs_auth(cache = FALSE)
  6. saveRDS(token, file = "googlesheets_shiny_token.rds")
  7.  
  8. # then this code in your app will authenticate and read in a workbook of your choice each time it's loaded
  9. gs_auth(token = "googlesheets_shiny_token.rds")
  10. sheet_key <- "your_google_sheet_key_here"
  11.  
  12. df <- gs_key(sheet_key) %>%
  13. gs_read_csv(ws = "worksheet_to_read")
Add Comment
Please, Sign In to add comment