Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
Shiny conditional input panel with vector

I am looking to create a conditional panel in shiny that becomes active if the input that user selects from a list (i.e. selectInput function) belongs to another vector.

I am aware that the condition in the conditional panel is a javascript element, however I cannot make it work.

Can someone help?

Here is the UI part of the code under examination:

legs1 <- c("HOUSE","VILLA","ATTICO")

selectInput("strategy", "Strategy:", choices = df[,6]),

conditionalPanel(
           
          condition = 'input.strategy && input.strategy.indexOf("legs1") > -1',
                              
          textInput("Leg1", "Leg1",value = ""),
          textInput("Leg2","Leg2", value =""),
          
          ),

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you don't have to access the vector from within the condition it should work by using

condition = "input.strategy && ['HOUSE', 'VILLA', 'ATTICO'].indexOf(input.strategy) > -1"
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda