Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pacman::p_load(
- tidyverse,
- plotly,
- shiny
- )
- ui <- fluidPage(
- sidebarLayout(
- inputPanel(
- selectInput(
- inputId="type",
- label="Tipo:",
- choices=unique(trend_data$type),
- selected="advert"
- )
- ),
- mainPanel(
- plotOutput(
- outputId="plot"
- ),
- tableOutput(
- outputId="table"
- )
- )
- )
- )
- server <- function(input,output) {
- trend_data <- read_csv("jorandradefig/193/input/google-trends/trend_data.csv")
- output$table <- renderTable({
- trend_data %>%
- filter(type == input$type)
- })
- output$plot <- renderPlot({
- data <- trend_data %>%
- filter(type == input$type)
- ggplot(data,aes(x=date,y=close)) +
- geom_line()
- })
- }
- shinyApp(ui,server)
Advertisement