Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started