Question: library ( shiny ) library ( shiny ) library ( tidyverse ) library ( gtrendsR ) library ( ggplot 2 ) library ( lubridate )
libraryshiny
libraryshiny
librarytidyverse
librarygtrendsR
libraryggplot
librarylubridate
DatagtrendskeywordcAPPLE'META'
Apple filterData$interestovertime, keyword "APPLE"
Meta filterData$interestovertime, keyword "META"
Apple$date asDateApple$date
Meta$date asDateMeta$date
ui fluidPage
titlePanelApple Hits Over Time'
sidebarLayout
sidebarPanel
dateRangeInputdaterange "Date range:",
start SysDate
end SysDate
plotOutputAppleplot"
dateRangeInputdaterange "Date range:",
start SysDate
end SysDate
plotOutputMetaplot"
server functioninput output
output$Appleplot renderPlot
output$Metaplot renderPlot
datamfilterAppledateasDateinput$daterange &
dateasDateinput$daterange
ggplotdatam
aesxdate,yhits
geompoint
xlabDate
ylabHits
shinyAppui server
Download data for names of any two companies of your interest from Google Trends. You can use the following example code: DatagtrendskeywordcAPPLE'META'
Create a Shiny app with daterange input to select a start date and an end date.
The Shiny app should show a point plot for both companies over time. The points should have different colors based on the company use color parameter of ggplot
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
