rDrop dropbox api non-expiring tokens/seamless token issues

你离开我真会死。 提交于 2019-12-05 18:54:58
library(rDrop) 
# my keys are in my .rprofile, otherwise specifiy inline
db_token <- dropbox_auth()
# Hit ok to authorize once through the browser and hit enter back at the R prompt.
save(db_token, file="my_dropbox_token.rdata")

Dropbox token are non-expiring and can be revoked anytime from the Dropbox web panel.

For future use:

library(rDrop)
load('~/Desktop/my_dropbox_token.rdata')
df <- data.frame(x=1:10, y=rnorm(10))
> df
    x          y
1   1 -0.6135835
2   2  0.3624928
3   3  0.5138807
4   4 -0.2824156
5   5  0.9230591
6   6  0.6759700
7   7 -1.9744624
8   8 -1.2061920
9   9  0.9481213
10 10 -0.5997218
dropbox_save(db_token, list(df), file="foo", ext=".rda")
rm(df)
df2 <- db.read.csv(db_token, file='foo.rda')
> df2
    x          y
1   1 -0.6135835
2   2  0.3624928
3   3  0.5138807
4   4 -0.2824156
5   5  0.9230591
6   6  0.6759700
7   7 -1.9744624
8   8 -1.2061920
9   9  0.9481213
10 10 -0.5997218

If you have additional problems, please file an issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!