conditionalPanel javascript condtions in shiny: is there R %in% operator in javascript? -


i trying build shiny application using conditionalpanel function shiny package. condition should written in javascript able use condition follows (written in r)

"tp53" %in% unlist(input$modelvariables) 

the documenatation states:

condition - javascript expression evaluated repeatedly determine whether panel should displayed.

i'm not familiar javascript @ all. i've tried input.modelvariables == 'tp53' doesn't work when input.modelvariables has length bigger 1.

my sidebarpanel fragment conditionalpanel below

                    checkboxgroupinput("modelvariables",                                         label = h3("which variables view?"),                                        choices = list( "cohort",                                                        "stage",                                                                "therapy",                                                                     "tp53",                                                        "mdm2" ),                                        selected = list("tp53")                                   ),                     conditionalpanel(condition = "'tp53' in unlist(input.modelvariables)",                                      checkboxgroupinput("modelvariablestp53",                                                          label = h3("which mutations view?"),                                                         choices = list( "missense",                                                                         "other",                                                                                 "wild"),                                                         selected = list("missense",                                                                         "other",                                                                                 "wild")                                                         ) 

according this answer condition should work (and works me) condition = "input.modelvariables.indexof('tp53') > -1"


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -