if statement in r mutate code example
Example: r mutate ifelse function
df <- df %>% mutate(target_bool = case_when(salary == ">50K" ~ TRUE, salary == "<=50K" ~ FALSE))
df <- df %>% mutate(target_bool = case_when(salary == ">50K" ~ TRUE, salary == "<=50K" ~ FALSE))