Data values are different in the graphic visualization of the shiny app

 #> ui<- fluidPage(
  titlePanel("Informe de vigilancia basada en laboratorio de la leptospirosis humana en Costa Rica"),
  sidebarLayout(
    sidebarPanel(
      selectInput("selection","Año:",
                  choices=Años),
      hr(),
      helpText("Datos del INCIENSA en 2019")
    ),
    mainPanel(
      plotOutput("Barplot")
    )
  )
)
server<- function(input,output)
{
  output$Barplot<-renderPlot({
    barplot(data1[Años==input$selection],
            main=input$selection,
            ylab="CasosPositivos", xlab="Meses",ylim=c(0,80), font.main=4,
            , col=1:12, legend=X.names)
    
  })
}
shinyApp(ui=ui,server=server)
plot(Año2015, col="green", type="b",
     ylim=c(0,80))

lines(Año2016,col="blue", type="b")
lines(Año2017, col="red", type="b")
lines(Año2018, col="grey", type="b")
ui<- fluidPage(
  titlePanel("Informe de vigilancia basada en laboratorio de la leptospirosis humana en Costa Rica"),
  sidebarLayout(
    sidebarPanel(
      checkboxGroupInput("selection","Año:",
                         choices=Años, selected=Año2015),
      hr(),
      helpText("Datos del INCIENSA en 2019")
    ),
    mainPanel(
      plotOutput("plot")
    )
  )
)

server<- function(input,output)
{
  output$plot<-renderPlot({
    plot(data1[Años==input$selection],
         main=input$selection,
         ylab="CasosPositivos", xlab="Meses",ylim=c(0,80), font.main=4,
         , col=1:12, legend=X.names,type="b")
    
  })
}

shinyApp(ui=ui,server=server)


Blockquote
When the graphic visualization is open the values of the x eje not concordance with the table data. Example: Number of positives cases in April in data table is 6, in the barplot is 6 but in shinyapp graffic visualization is 1.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.