将 R 与 Google Analytics 结合使用 [英] Using R with Google Analytics

查看:27
本文介绍了将 R 与 Google Analytics 结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个很棒的项目,叫做 r-google-analytics,我想使用它,这样我就可以在这个网站上操作 R 中的 GA 数据http://code.google.com/p/r-google-analytics/.

I found a great project called r-google-analytics that I'd like to use so I can manipulate GA dat in R at this website http://code.google.com/p/r-google-analytics/.

我运行这部分代码:

library(RCurl)

library(XML)

# 1. Create a new Google Analytics API object 
ga <- RGoogleAnalytics()  
# 2. Authorize the object with your Google Analytics Account Credentials
ga$SetCredentials("INSERT_USER_NAME", "INSERT_PASSWORD") 

我收到此错误消息:

Error in postForm("https://www.google.com/accounts/ClientLogin", Email = username,  : 
  SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

关于什么可能导致错误的任何想法?

Any ideas as to what could be causing the error?

谢谢!

推荐答案

参见 http://www.omegahat.org/RCurl/FAQ.html 以获得详尽的解释,特别是(取决于您对安全性的偏好):

see http://www.omegahat.org/RCurl/FAQ.html for a thorough explanation and particularly (depending on your preference for security):

如果您没有来自适当签名代理的证书,您可以使用 ssl.verifypeer 选项禁止验证证书:

If you don't have a certificate from an appropriate signing agent, you can suppress verifying the certificate with the ssl.verifypeer option:

x = getURLContent("https://www.google.com", ssl.verifypeer = FALSE)

x = getURLContent("https://www.google.com", ssl.verifypeer = FALSE)

这篇关于将 R 与 Google Analytics 结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆