Answered step by step
Verified Expert Solution
Question
1 Approved Answer
library ( shiny ) library ( gtrendsR ) library ( ggplot 2 ) ui < - fluidPage ( titlePanel ( Google Trends Data Visualization
libraryshiny
librarygtrendsR
libraryggplot
ui fluidPage
titlePanelGoogle Trends Data Visualization"
sidebarLayout
sidebarPanel
dateRangeInputdateRange "Select Date Range",
start
end formatSysDateYmd
actionButtonsubmit "Generate Plot"
mainPanel
plotOutputtrendPlot
server functioninput output
observeEventinput$submit,
reqinput$dateRange
startdate formatinput$dateRangeYmd
enddate formatinput$dateRangeYmd
Data gtrendskeyword cAPPLE 'META' geo US time pastestartdate, enddate
ggplotData aesx date, y hits, color keyword
geompoint
labstitle "Google Trends Data",
x "Date",
y "Search Volume"
shinyAppui ui server 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