Open ekmcintyre opened 3 years ago
It looks like you are not referencing the variable correctly.
What is your widget code, especially the input ID?
Does the input$id reference match with what is in the function get_variable_x()?
Here id would be replaced by whatever you named your widget. For example, it was called input$demographics in the demo code:
radioButtons( inputId="demographics",
label = h3("Census Variables"),
# choices = these.variables,
choiceNames=temp.names,
choiceValues=these.variables,
selected="pnhwht12")
Your input$id slot will store the currently selected variable name.
My code for the input is this
radioButtons( inputId="demographics",
label = h3("Census Variables"),
choiceNames=mean.labels,
choiceValues=these.variables,
selected="Percent White")
And my code in the output is this
mutate( q = ntile( get(input$demographics), 10 )
Your selected= argument should reference a variable name, not a label.
Okay that fixed it.
👍
I made sure to include the as.numeric argument in my code for variable distributions
x <- get_variable_x() %>% unlist() %>% as.numeric()
and now keep getting an error saying character (0). Does this have to do with the variables I have selected?