2013-04-29 108 views
7

我試圖導入谷歌趨勢的結果爲R.谷歌趨勢中的R

我試圖rGtrendsRGoogleTrends。第一個似乎卡住下載CSV文件:

> require(devtools) 
> install_github("rGtrends","emhart") 
> library(rGtrends) 
> my_terms <- c("Twitter", "Myspace") 
> twit_ms <- rGtrends(my_terms) 
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : 
Traceback (most recent call last): 
File "<string>", line 1, in <module> 
File "C:/.../Documents/R/win-library/3.0/rGtrends/src/pyGTrends.py", line 105, in csv 
raise Exception("Could not find requested section") 

我有在(不知道爲什麼我需要給我的谷歌的用戶名和密碼,反正有簽約的問題我可以探索在我browswer谷歌趨勢沒有第二個?這樣做。)

+1

作爲警告,請停止使用微不足道的編輯來「碰撞」您的問題。如果你再次這樣做,我會鎖定這個問題。 – 2013-05-19 18:56:59

回答

3

這不是R問題。

pyGTrends home pageissues section of rGTrends的評論部分的快速閱讀揭示了此類行爲的各種原因的持續列表,並且似乎主要的罪魁禍首是隨着谷歌趨勢的認證更改。即:有時pyGTrends適用於某些使用2因素身份驗證的應用程序,其他時間則適用於其他人使用;有時候用戶需要設置一個cookie,有時候不需要。

1

試試這個。它應該使用最新的Google趨勢數據格式。

require(devtools) 
install_github('googletrend','okugami79') 

library(googletrend) 

# You need to Login http://google.com/trends on your browser!! 

x<- gettrend(keyword='Twitter')