![]() ![]() ![]() ![]() Why don't we take a look at our new dataframe using harveyMerged %>% dplyr::glimpse(78)? state.ĭplyr::mutate(region = stringr::str_to_lower(location)) Now, let’s compare the amount of interest in Hurricane Harvey for each U.S. $ value : chr "new orleans hurricane katrina" "hurricane new orleans" "new orleans" "what was hurricane katrina". $ related_queries: chr "top" "top" "top" "top". $ hits : int 100 NA 65 NA NA 50 NA NA NA NA. $ location: chr "New Orleans" "Metairie" "Baton Rouge" "Hattiesburg". $ location: chr "Biloxi-Gulfport MS" "New Orleans LA" "Baton Rouge LA" "Hattiesburg-Laurel MS". $ location: chr "Louisiana" "Mississippi" "Alabama" "Arkansas". $ keyword : chr "hurricane katrina" "hurricane katrina" "hurricane katrina" "hurricane katrina". To understand what is actually measured on the y-axis, have a look here. The above plot shows clear spikes around the time when Katrina and Harvey hit the U.S. We’ll also add change some of the plot settings by creating our own ggplot theme. Let’s first look at how the impact of hurricanes Katrina (August 2005) and Harvey (August 2017) are reflected in how Americans have used these names as google search items over time. To restart: fn + command + shift + F10.)ĭevtools::install_github('PMassicotte/gtrendsR') (A restart of R Studio might be required for gtrendsR to function properly. Note that we use devtools to download a developer version of gtrendsR from Github. mainland and then plot how often different states search for “guns.” Load packagesįirst, we load the required packages. In this example, we will look at search interest for named hurricanes that hit the U.S. This is a quick introduction on how to get and visualize Google search data with both time and geographical components using the R packages gtrendsR, maps and ggplot2. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |