I am trying to create an interactive plot for airquality in shiny but I keep getting the error "Warning: Error in writeImpl: Text to be written must be a length-one character vector
[No stack trace available]"
I'm not sure what this means does anyone have any solutions?
I have included my code below,
Thanks in advance!
library(shinydashboard)
library(datasets)
ui<-dashboardPage(
dashboardHeader(title= airquality),
dashboardSidebar(collapsed = TRUE),
dashboardBody(
fluidRow(
plotOutput("airquality",
click="single_Click"
),
box((verbatimTextOutput("coords")),width=12)
)
)
)
server<-function(input,output){
output$airquality<-renderPlot({
plot(x=airquality$Ozone, y=airquality$Day,
xlab="Ozone",ylab="Day",
pch=as.character(airquality$Temp))
})
output$coords<-renderprint({
nearPoints(airquality, input$single_click,
xvar="Ozone", yvar="Day",
threshold = 20)
})
}
shinyApp(ui=ui, server=server)