I created some switches in Shiny; However, I am wondering if there is a way to return the return value an integer, not a character.
The desire for integers appeared in the context of RadioButton used to select gender.
When I do this:
radioButtons(inputId="gender", "Gender", choices = list("combined" = 0, "male" = 1, "female" = 2)
I find that
print(str((input$gender)))
gives me
chr "0"
I know I can change this on the server:
gender <- as.integer(input$gender)
but I try to clear this code by cutting down the lines.
Is it possible to change the type of output in the user interface?
source share