When I check input$num for an autonumericInput with inputId = "num", the value is zero for no input and for input=0. How do I tell the difference? The output of the code below is 0 for both no input and 0.
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
shinyWidgets::autonumericInput(
inputId = "num",
label = "Enter a number:",
value = NA # I also tried NULL. Same result.
)
)
server <- function(input, output) {
observe({
print(input$num)
})
}
shinyApp(ui = ui, server = server)
Using shinyWidgets_0.6.0
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Amazon Linux 2
When I check input$num for an autonumericInput with inputId = "num", the value is zero for no input and for input=0. How do I tell the difference? The output of the code below is 0 for both no input and 0.
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
shinyWidgets::autonumericInput(
inputId = "num",
label = "Enter a number:",
value = NA # I also tried NULL. Same result.
)
)
server <- function(input, output) {
observe({
print(input$num)
})
}
shinyApp(ui = ui, server = server)
Using shinyWidgets_0.6.0
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Amazon Linux 2