15

I am trying to log into my Google account in R using gconnect() in the gtrendsR package, but am running into issues. I have been doing research using Google Trends data for the last month, and have never had a problem with this.

Please let me know if you have any thoughts. I had Google Support take a look at my account to see if there were any holds or something, but nothing showed up. Also tried logging in through another account which didnt work..

This is what I am trying to do:

usr <- 'my_username@gmail.com'
psw <- 'my_password'
gconnect(usr, psw)

And then I am returned with the following error:

Google login failed! Check your login information.NULL

Tim de Silva
  • 314
  • 1
  • 13
  • I get this error while connecting Error in strsplit(val, "[:=;]")[[1]] : subscript out of bounds – Chirayu Chamoli Jul 29 '16 at 06:41
  • 1
    If you have two-factor authentication enabled with your Google account you might need to use an application-specific password – Phil Jul 30 '16 at 21:22

3 Answers3

1

It seems there is no quick solution for gtrends. However, I discovered a URL which directly downloads the data.

This url is the link of 'download as csv' menu in Google Trends. However, direct fetching from R by download.file function is problematic.

Nayantara Jeyaraj
  • 2,624
  • 7
  • 34
  • 63
Suat Atan PhD
  • 1,152
  • 13
  • 27
1

See this page: https://www.google.com/settings/security/lesssecureapps. Try switching to "on" if the setting is "off".

SCallan
  • 681
  • 9
  • 26
  • So I have a 2-step authentication and the article states if you are using Mac OSX of latest version, it's not an issue to access Google despite having 2 - step auth. Any workaround? – Chaitanya Bapat Aug 25 '17 at 16:41
0

Log into your Google Account again and check if it works now. I had the same problem but miraculously everything works again today. It seems to me as if Google sometimes moves accounts into some sort of quarantine state and releases them after a while.

sebolus
  • 41
  • 4