In my dashboard I want to create a year range input slider. But I'm getting the following error:
Tibble columns must have consistent lengths, only values of length one are recycled:
* Length 0: Columns y
, linetype
, .plotlyGroupIndex
* Length 2: Column x
Avg <- Hollywood %>% group_by(Genre,year)
Avg <-Avg %>% summarise(avg_Gross=mean(WorldwideGross, na.rm = TRUE))
Avg$year <- factor(Avg$year)
Inputs {.sidebar data-width=350}
sliderInput("Year", "year", 2005, 2014, value = c(2005, 2014), sep = "")
Column
Chart B
average <- reactive({
Avg[Avg$year==input$Year,]
})
renderPlotly({
p2 <- plot_ly(average(), x = input$Year, y = ~avg_Gross, type = 'scatter', mode = 'lines', linetype = ~Genre)
print(p2)
})