Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Trends in R [closed]

Tags:

r

I am trying to import Google Trend results into R.

I have tried rGtrends and RGoogleTrends. The first seems to get stuck downloading the CSV file:

> 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")

The second I having problems with signing in (not sure why I need to give my google username and password anyway? I can explore google trends in my browswer without doing so.)

like image 239
guyabel Avatar asked Apr 29 '13 09:04

guyabel


1 Answers

This isn't an R issue.

A quick read of the comments section on the pyGTrends home page and of the issues section of rGTrends reveals an ongoing listing of various causes for this type of behavior and it seems that the main culprit is authentication changes with google trends. ie: Sometimes pyGTrends works for some with 2 factor authentication, and other times for others it doesn't; sometimes the user needs to set a cookie and sometimes not.

like image 180
Thell Avatar answered Oct 30 '22 11:10

Thell