Shiny: varSelectInput: typo in documentation, and would also help to make it clear why it's needed

Created on 23 Feb 2019  路  1Comment  路  Source: rstudio/shiny

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 :)

Novice Low Low Type

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings