I'm working to create factor variables from numeric column, but i want to use listed value as parameter for desired column. I have been able to select a column based on vector input but still unable to do it inside mutate case_when
var1 = "transfer"
var2 = "transfer_tier"
tier <- trx %>%
select_(.dots = var1) %>%
mutate_(var2 = case_when(
var1 <= 1e3 ~ '1. <1k',
var1 <= 1e4 ~ '1. <10k',))
using above code shows no error but the formula that i want does not work. var2 is created with all NA. how to call var1 properly?