Google Trends Data Mining Using R
3.9 (11 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
228 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Google Trends Data Mining Using R to your Wishlist.

Add to Wishlist

Google Trends Data Mining Using R

Building an automated solution to download Google Trends data for a large number of terms.
3.9 (11 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
228 students enrolled
Last updated 2/2017
Current price: $10 Original price: $35 Discount: 71% off
5 hours left at this price!
30-Day Money-Back Guarantee
  • 2 hours on-demand video
  • 5 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Set up your own process in R to autonomously download and process large amounts of Google Trends data.
  • Automate various tasks used in a day to day life of a data scientist through R.
  • Understand each line of code used in the course and how it fits in the bigger picture of a live project.
  • Two independent approaches used in the course to access Trends data will reinforce the concept of building R solutions from scratch. In one approach, we will exclusively use Base R methods, and in other, learn how to work with R packages.
  • You will be able to run various windows commands from R e.g. copy, rename, delete files on hard disc etc
  • Use Window's Task Scheduler to have desktop run R in batch mode on recurring basis.
  • Your R toolbox will become much more diverse and applicable to a wide range of future projects.
View Curriculum
  • No prerequisites, previous exposure to R and windows work environment will be helpful..
  • You will need access to R, Windows, Google account, Chrome.

Google Trends is a new tool in a Data Scientist or a Marketing Analyst's tool box. It provides data that could be quite useful when assessing trend in general public interest in a particular product or an array of products. Trends data essentially gives us a way to assess how often a particular search was performed on world's most popular search engine. 

However, Google Trends only allows a simultaneous search of up to five terms, also it does not provide data through a dedicated API. This course describes two processes in R which could be employed to circumvent both of these issues. First process stitches together R and Windows batch system. Second, utilize gtrendsR package. In both case we set up an automated process. 

 The course begins by describing Google Trends data itself, and then various R functions relevant to build the automated solution. In the third section, we apply the knowledge from previous sections to build a complete end to end solution. 

By the end of the course, we will better understand how R could be employed in more automated manner with minimum human involvement. Additionally, better appreciate the power of Google Trends data to provide a greater understanding of the way the world around us functions.

Who is the target audience?
  • Those wanting to retrieve and explore large amounts of Google Trends data.
  • Students with beginner level of R understanding and those wanting to join course which is not typical beginner's curriculum. We will stay focused on using R to automate a software process.
  • We will NOT deal with any statistics here!
Students Who Viewed This Course Also Viewed
Curriculum For This Course
14 Lectures
Introduction to Google Trends web Search engine
1 Lecture 06:31
  • Introduction to Google Trends as a tool for deriving interesting insights about the world around us.
  • Understand the layout of Trends data.
  • Bottlenecks associate with Google Trends website.
Preview 06:31
Understanding R functions one at a time
9 Lectures 01:10:56
  • Import and Export of text files using read.table and read.csv functions.
  • Export R data files using write.csv and write.table functions.
  • Address various commonly faced issues.
Import Export of txt and csv files

  • Create data frames.
  • Create calculated variables.
  • Change variable names in an existing data frame.
Data Frames in R Part 1

Data Frames in R Part 2

Use systems command to:

  • Create Directories.
  • Copy multiple files.
  • Rename files.
  • Use wild cards (characters) in these functions to allows selection of files with a particular characteristic.

Reinforce the concepts for lapply and functions to read in multiple files and stack them using rbind function.

Performing system functions using R

  • Create list objects and sub set them.
  • Distinguish between lapply and functions.
  • Combine lapply and functions to achieve desired outcomes.
Preview 07:10

  • Conceptualize the manual steps and how to automate them using R.
  • Capture the string that is submitted to Google Trends servers from Chrome's 'Inspect Element' Tools menu.
  • Set up a batch script to open Chrome and download a particular response from a server.

Review Windows Batch processes

  • Use R to write a .bat (batch) file.
  • Execute batch files from R.
Write a Windows Batch process from R

Combinding the power of Batch files with R "For loops"

  • Understand the concept of Anchor term and its role as 'equalizer' of data across search terms.
  • learn to identify an Anchor term from the collection of search terms.
  • Modify an existing batch file to include two search item simultaneously.
  • Create a Pivot chart in Excel to visualize the data.

Use of an Anchor search term to enable comparative analysis of Trends data
Bringing it all together: Setting up the automated R process.
2 Lectures 15:04
  • Put together all the functions described above in the context of a bigger project.
  • Set up a file as a repository for search terms used in a project.
  • Use for loop to iterate over all the search terms to create and execute batch files specifically created for each search term.
Automating a Google Trends data download.

  • Set up your first automated task using Task Scheduler, Batch file, and a R script.
  • Precautions needed when downloading data for a large number of terms on a slow internet or machine.
  • Override a scheduled task in Windows Scheduler.
Scheduling Trends Data Download using R script, .bat, and Task Scheduler
Section 4: Using gTrendsR package
2 Lectures 12:04
  • Understand different options offered by gTrendsR package to access Trends data.
  • Use various options in gtrends() such as query vector, geographical area, start date , end date,  resolution etc.
  • Dissect the list object returned by gtrends() after querying Google Trends.
Getting started with gTrendsR package

Use gTrendsR to download large amounts of data
About the Instructor
Sanjeev Baniwal  Ph.D.
3.9 Average rating
11 Reviews
228 Students
1 Course
Data Scientist

I have played at the forefront of data analytics for the last 15 or so years. Until 2010, I worked at University of Southern California, Los Angeles as Assistant Professor and then moved to The Nielsen Company to join Analytics team focused in Social Media and Entertainment space.  I am interested in using the power of Big Data to understand basic human behaviour when making a choice. 

Apart from Data Science, my interests include Baseball, Cricket, and Hiking.