在R studio中为Mac设置证书位置时出错
我在尝试使用R获取推文时遇到了一个证书错误。我环顾四周,发现对于windows,需要安装rCurl库。我找不到mac的任何信息。我尝试了windows的建议,但什么也找不到。非常感谢您的帮助在R studio中为Mac设置证书位置时出错,r,twitter,osx-lion,R,Twitter,Osx Lion,我在尝试使用R获取推文时遇到了一个证书错误。我环顾四周,发现对于windows,需要安装rCurl库。我找不到mac的任何信息。我尝试了windows的建议,但什么也找不到。非常感谢您的帮助 install.packages('twitteR') install.packages('plyr') install.packages('stringr') install.packages('ggplot2') library(plyr) librar
install.packages('twitteR')
install.packages('plyr')
install.packages('stringr')
install.packages('ggplot2')
library(plyr)
library(stringr)
library(ggplot2)
library(twitteR)
requestURL <- "https://api.twitter.com/oauth/request_token"
accessURL = "http://api.twitter.com/oauth/access_token"
authURL = "http://api.twitter.com/oauth/authorize"
consumerKey = "xxxxxxxx"
consumerSecret = "xxxxxxxx"
Cred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,
requestURL=requestURL,
accessURL=accessURL,
authURL=authURL)
Cred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl") )
7699317
registerTwitterOAuth(Cred)
save(Cred, file="twitter authentication.Rdata")
是因为我在mac电脑上工作吗?还是我的代码有问题
谢谢 我不得不再次下载证书。可能是R的安装版本更早。通过添加下面的代码,它工作得很好
download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")
library(RCurl)
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))
download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")