Estoy tratando de replicar el código HTML en shiny. Pero no funciona. Pero HTML puro sin obras brillantes. Básicamente, lo que sea que ponga en el cuadro, el typeof debería regresar.
Puede consultar mi publicación anterior aquí Obtenga el tipo de valor ingresado
library(shiny) library(shinydashboard) library(shinyjs) ui <- dashboardPage( dashboardHeader(title = "Basic dashboard"), dashboardSidebar(collapsed = TRUE), dashboardBody( HTML('<p id="res">Value</p><input type="text" id="fname" name="fname"><br><br>'), tags$script( "document.getElementById('fname').addEventListener('input', e => { const value = e.currentTarget.value; const checkType = isNaN(Number(value)) ? value : Number(value) document.getElementById('res').textContent = typeof checkType })"), useShinyjs(), actionButton("release", "Release")) ) server <- function(input, output) { observeEvent(input$release,{ # tags$head(tags$script("$('body').toggleClass('sidebar-collapse');")) toggleClass(selector = 'body', class = 'sidebar-collapse') # js$toggleCollapse() }) } shinyApp(ui, server)