# NOT RUN {
## load/refresh existing credentials, if available
## otherwise, go to browser for authentication and authorization
drive_auth()
## force a new oauth token to be obtained
drive_auth(reset = TRUE)
## store token in an object and then to file
ttt <- drive_auth()
saveRDS(ttt, "ttt.rds")
## load a pre-existing token
drive_auth("ttt.rds") # from .rds file
## use a service account token
drive_auth(service_token = "foofy-83ee9e7c9c48.json")
# }
Run the code above in your browser using DataLab