referencing selectizeInput

Hi all,

wanted to check if we can reference the the input selected from selectizeInput can be referenced.

I tried with below but could not get

selectizeInput("cat", "Cat", 
                             choices = c("a","b","c"),options = list(maxItems = 2)) 

Referencing, if the user selects "a" and "b",

can we input$cat[1] be "a" and input$cat[2] be "b" ???

Similarly, if the users selects "c" and "a",

can we input$cat[1] be "c" and input$cat[2] be "a" ???

Please guide if there is any alternate?

I think input$cat just returns a vector of strings. I think the strings will be in order of the choices vector, or might be alphabetical. I don't think it will be in order that the user selected them. You might have to test it.

So it's a good time to use %in%, e.g.,

if ("a" %in% input$cat){...

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.