Q: Get name from value in R (setNames example) How can I extract corresponding NAME_X based on the value.
CHOICES <- setNames(c(0, 1), c("NAME_1", "NAME_2"))

For example get_name(0) should return "NAME_1" and get_name(1) should return "NAME_2".
To provide context, I am using those choices in selectInput of my Shiny app.
