I'm trying to create a dashboard for the airquality dataset with brushing capability in shinydashboard, but I keep getting "Error: need finite 'xlim' values". I can't figure out why as I went step by step from my text book. Can anyone advise? Below is my code...
library(shinydashboard)
library(datasets)
ui <- dashboardPage(
dashboardHeader(title = "Brushing"),
dashboardSidebar(collapsed = TRUE),
dashboardBody(
fluidRow(
plotOutput("AirqualityPlot",
brush = "brushing"
),
box((verbatimTextOutput("coords")),width = 12)
)
)
)
server <- function(input,output){
output$AirqualityPlot <- renderPlot({
plot(x=airquality$wind, y=airquality$temp,
xlab = "Wind (mph)", ylab="Temperature(F)",
pch=as.character(airqualityl$ozone))
})
output$coords <- renderPrint({
brushedPoints(airquality, input$brushing,
xvar = "wind", yvar = "temperature")
})
}
shinyApp(ui = ui, server = server)
I thought maybe because there are "NA" values in the airquality dataset, so I used tibble an tidy to eliminate the "NA" values, but there was no change in the result.