ConditionalPanel doesn't support variables with dot in the name, any work around?

r, shiny

Solution

In `conditionalPanel` the condition is a Javascript expression. You are relying on Javascript's dot notation when you type "input.test".

You don't have to change your variable names. There is a simple workaround, just use the square bracket notation instead: `input["tes.t"]`

 checkboxInput("tes.t", label="tes.t", TRUE),
    conditionalPanel(
      condition='input["tes.t"]',
      h2("tes.t tes.t")

will work.

Problem

This would work ``` checkboxInput("test", "test", TRUE), conditionalPanel( condition="input.test", h2("test test") ), ``` but this not ``` checkboxInput("tes.t", "tes.t", TRUE), conditionalPanel( condition="input.tes.t", h2("tes.t tes.t") ), ``` Where in the document does it say the name with dots are not supported? Are there any work around so I don't have to change my variable names?

Original source