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.

Required Packages

# Run once to install
install.packages(c("gtrendsR", "tidyverse", "ggplot2", "scales",
                   "lubridate", "knitr", "kableExtra"))
library(gtrendsR)     # Pull data from Google Trends
library(tidyverse)    # Data manipulation and plotting
library(ggplot2)      # Visualization
library(scales)       # Axis formatting
library(lubridate)    # Date handling
library(knitr)        # Tables
library(kableExtra)   # Enhanced table formatting

Understanding the gtrends() Function

“now 1-H” → Past hour “now 4-H” → Past 4 hours “today 1-m” → Past 30 days “today 3-m” → Past 90 days “today 12-m” → Past 12 months “today+5-y” → Past 5 years “all” → Since 2004

Tutorial 1: Single Keyword — Brand Search Interest

References

Google Trends. (2024). Google Trends Tutorials [YouTube series]. Google Search Central. https://developers.google.com/search/blog/2024/09/google-trends-tutorials Massicotte, P., & Eddelbuettel, D. (2023). gtrendsR: Perform and Display Google Trends Queries [R package]. https://cran.r-project.org/package=gtrendsR Chan, M. (2019). Vignette: Google Trends with the gtrendsR package. https://martinctc.github.io/blog/vignette-google-trends-with-gtrendsr/