Showing posts with label weekly data. Show all posts
Showing posts with label weekly data. Show all posts

Wednesday, December 03, 2014

Converting Google Trends weekly data into a regular date in R

Getting dates in the right format is always a big headache when getting your data ready for analysis. Google Trends provides data on three levels, monthly, weekly or daily. Here, I explain how to convert Google Trend's weekly dates into R's date class.

The weekly date format used by Google Trends looks like this:

2004-01-04 - 2004-01-10
 

This might pose a problem for instance if we want to plot the data. We will need to convert the date interval provided by Google Trends into a single date. We can do so using the following code:

#First, import the data 
data=read.csv(filePath, header=F, blank.lines.skip=F)
 
#Then select the ending date of the date interval
data[,1]=sapply(data[,1], substr, start=14, stop=30)
 
#And convert it into a date 
data[,1]=as.Date(data[,1], "%Y-%m-%d")
 
And then you have a date format that you can use for plots or data analysis.


 

Wednesday, October 29, 2014

Analysis of daily, weekly and monthly Google Trends data

How will our analysis of search behavior differ if we look at short or long time spans? Here's and example of the search volumes for Supercell's games Boom Beach, Hay Day and Clash of Clans.

Monthly, 2004-present


Boom Beach and Clash of Clans seems to be doing well.

Weekly, past 12 months

When looking ag the weekly data, we see that only Clash of Clans seems to have made any significant gains during the past 12 months.

Daily, past 90 days


The daily data reveals a weekday pattern, where searches during the weekends are higher. There is no increasing trend for either of the games.

Conclusion

The choice of time horizon when when analyzing Google Trends data can make a big difference. It is important to have a clear idea of why a certain time horizon has been chosen for analysis.
Entertaining Blogs - BlogCatalog Blog Directory
Bloggtoppen.se