My app opens up but I get an error:Error in getDataset: could not find function "getDataset". I am new to Shiny so I am not sure what is up.
server <- (function(input, output) {
getDatasett<-reactive({
if(input$year=="2020")
{
return("df2020")
}
else if (input$year=="2019")
{
return("df2019")
}
else if (input$year=="2018")
{
return("df2018")
}
else
{
return("2017")
}
})
output$caption<-renderText({
paste("Dataset: ", input$year)
})
output$ts_plot<-renderPlot(({
ts_plot<-ts(getDataset(),aes(x="Closed",y=n,frequency=12))
plot(ts_plot)
})
)
})
shinyApp(ui = ui, server = server)