I am trying to use case_when in shiny application in order to build an app, showing the preview of some selection policy expressed as a set of rules.
In the app, user can input expressions in case_when syntax, e.g.:
cond = "Age > 40 ~ 1, TRUE ~ 0"
and they should be substituted in case_when.
I am looking at rlang and trying to figure out how to get an expression from a character vector, e.g.
tibble::tribble(~Age,23,26,32,50,51,52,25,49,34,54) %>%
mutate(result = case_when(!!!quos(syms(cond))))
but, apparently, fail to get it right