在继续之前,请RGoogleTrends_0.2-1.tar.gz
在此处下载,这是 Duncan Temple Lang 的网站。
可重现的示例(或者,至少,我希望它可以被某人重现):
op <- par(no.readonly = TRUE)
Sys.setenv(TZ = 'UTC')
# In the command line below please insert the path of your RGoogleTrends package
install.packages('C:/.../RGoogleTrends_0.2-1.tar.gz', repos = NULL, type = 'source')
install.packages('DBI')
install.packages('quantmod')
install.packages('RCurl')
install.packages('RSQLite')
require(DBI)
require(RCurl)
require(RGoogleTrends)
require(RSQLite)
我使用以下参数创建了一个 Google 帐户:
login = cicciopafolr@gmail.com
password = econfol1
然后RGoogleTrends
代码:
# The example below comes from RGoogleTrends package.
## Not run:
# Picks up c(login = password) from GooglePassword option
# i.e. set with
options(GooglePassword = c(cicciopafolr = 'econfol1'))
g = googleSignIn()
ans = getGTrends("coupon", curl = g)
## End(Not run)
代码结果:
> g = googleSignIn()
Error in function (type, msg, asError = TRUE) :
SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
我的sessionInfo()
:
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] parallel stats graphics grDevices datasets utils methods base
other attached packages:
[1] RSQLite_0.11.3 RCurl_1.95-4.1 bitops_1.0-5 quantmod_0.4-0
[5] TTR_0.21-1 Defaults_1.1-1 DBI_0.2-6 RGoogleTrends_0.2-1
[9] Matrix_1.0-11 lattice_0.20-13 MASS_7.3-23 truncnorm_1.0-6
[13] numDeriv_2012.9-1 xts_0.9-3 zoo_1.7-9 RcppArmadillo_0.3.6.3
[17] Rcpp_0.10.2 rcom_2.2-5 rscproxy_2.0-5
loaded via a namespace (and not attached):
[1] grid_2.15.2 tools_2.15.2