0
votes

I am trying to render a Data table in R shiny on selected inputs but getting an error:-

output$reconOutput <- renderUI({

    reconOutput <- sort(unique(as.vector(my_data$ReconIdName)), decreasing = FALSE)
    reconOutput <- append(reconOutput, "All", after =  0)
    selectizeInput("reconchoose", "Recon:", reconOutput)

  })


  output$statusOutput <- renderUI({

   statusOutput <- sort(unique(as.vector(my_data$Status)), decreasing = FALSE)
   statusOutput <- append(statusOutput, "All", 0)
   selectizeInput("statuschoose", "Status:", statusOutput)

 }) 

output$issuesbyReconName<- renderDataTable(
  data <- reactive({

    req(input$reconchoose)
    req(input$statuschoose)


    if(input$reconchoose == "All") {

      filt1 <- quote(recon != "@?><")


    } else {

      filt1 <- quote(recon == input$reconchoose) 

    }


   if (input$statuschoose == "All") {

   filt2 <- quote(status != "@?><")


   } else {

     filt2 <- quote(status== input$statuschoose)

 }



    raw %>%
      filter_(filt1) %>%
      filter_(filt2)


  })
)

Could you please guide me on this?

output$issuesbyReconName 1: shiny::runApp Warning: Error in if: missing value where TRUE/FALSE needed

Is it related to any null value in columns that is creating a conflict in the code?

1

1 Answers

0
votes

Can you share your input side code as well? It looks like it might be caused by there being no default value for some of the input objects, leading to the error.

Try either to set a default value for these objects or start the IF series with something like

if (is.na(input$reconchoose)) return("") else