varSelectInput: typo in documentation, and would also help to make it clear why it's needed
I just looked over the docs for the new varSelectInput and ran into trouble trying to parse this sentence: https://github.com/rstudio/shiny/blob/c79034649077f5fa6f8d615ce10c457eb33a2d2a/R/input-select.R#L240-L244
Another thing I wasn't able to pick up from the documentation is why this input is even necessary and made it into the very elite list of inputs supported by shiny. It feels very esoteric, and I'm having a hard time rationalizing why shiny added it.
The documentation didn't offer much insight other than saying it returns symbols, but it would be helpful if the docs were more explicit on why exactly this is useful. I also looked at @schloerke 's example app from the PR and it still seems to me that the only reason this exists is to return a symbol.
If that is the reason for this input, then would it make sense to instead offer a symbol = TRUE/FALSE parameter for select inputs, so that this would be more generic rather than only work for dataframes? The specificity of this input feels a bit forced to suit a very particular need that isn't a general shiny need. Adding more clear documentation about its usage would clear this up :)
Thanks for the thoughtful feedback, as always!
Yes, varSelectInput only exists to return symbols; it makes it a little easier to work with tidyeval, as in the example you pointed to. Otherwise, you'd have to cast the input to a symbol using sym() which is not intuitive, and the error messages wouldn't point you in that direction if you didn't.
I agree that it's a pretty borderline use case for inclusion in Shiny. Not a ton of thought/debate went into its inclusion; someone within RStudio suggested it, @schloerke jumped on it and submitted a PR, and I thought it was a reasonable addition.
The symbol parameter is a good suggestion, I don't know if any of us thought of that. It's too late to retract varSelectInput now though, as it's gone to CRAN with v1.2.0. Though going forward, I think it'd make sense to also accept a character vector of names (or a list of symbols for that matter) if you don't want to pass something with colnames.
I just noticed that on shiny's landing page the very first example showing a Shiny app in R is using varSelectInput(), which reminded me of this old issue.
I appreciate that it results in slightly shorter and cleaner code, but I do wonder whether beginners who are trying to understand a piece of code where everything looks new and intimidating would benefit from having conceptually simpler code. Using symbols is not something that is easily understood by most R developers. If you were trying to explain to a typical R user what selectInput() does, what it returns, and how to use it in a ggplot, I think it would be easier to comprehend than varSelectInput().
I personally choose not to teach varSelectInput() because I find it's less easy to understand and offers only marginally less code. I'd understand if you disagree, but I wanted to offer my two cents. You can close this issue if you feel it has been addressed.