R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.

Intro

Disclaimer - This is based on a previous tutorial I developed and published at AWS in 2018:

Ref: http://rstudio-pubs-static.s3.amazonaws.com/429204_d8bf19f64be94808820552b05cc614e1.html

In this tutorial, you will learn how to create a series of really cool data visualization that usually appear in the Economist or New York Times.

Why use R?

Using Google Trends manually is fun. However, it could be time-consuming and tedious if you would like to compare different search terms over different time frames.

In this tutorial, I introduce the tool by accessing it directly through a web browser to extract data and analyze it in R. In particular, the main package used will be “gtrendsR” (intro to this package available at https://github.com/PMassicotte/gtrendsR)

Have fun!

Which candidate in PA received the most attention?

## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.

Which candidate in TX received the most attention?

Which party received the most attention?

Which party received the most attention?

Which candidate in WI received the most attention?

Which candidate in AZ received the most attention?

Which candidate in GA received the most attention?

Which candidate in OH received the most attention?