1
twitteR R Package OAuth issue: Error in registerTwitterOAuth(cred) :    
oauth argument must be of class OAuth

这是我在 R 中使用的代码,用于在我第一次进行身份验证后加载身份验证。

我不断收到错误:

Error in registerTwitterOAuth(cred) : oauth argument must be of class OAuth

从以下代码:

download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="/xxx/xxx/xxx/cacert.pem")

# to get your consumerKey and consumerSecret see the twitteR documentation for instructions
cred <- OAuthFactory$new(consumerKey='xxxxxxxxx',
                         consumerSecret='xxxxxxxxx',
                         requestURL= NOTE UNABLE TO POST LINKS IN THE POST
                         accessURL = NOTE UNABLE TO POST LINKS IN THE POST
                         authURL= NOTE UNABLE TO POST LINKS IN THE POST)

# necessary step for Windows / Mac
cred$handshake(cainfo="/xxx/xxx/xxx/cacert.pem")

# save for later use for Windows / Mac
save(cred, file="/xxx/xxx/xxx/twitter authentication.Rdata")
cred <- load("/xxx/xxx/xx/twitter authentication.Rdata")
registerTwitterOAuth(cred)
4

1 回答 1

1

做就是了:

load("/xxx/xxx/xx/twitter authentication.Rdata")

代替:

cred <- load("/xxx/xxx/xx/twitter authentication.Rdata")
于 2013-08-02T13:42:48.473 回答