Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

r mutate ifelse function

df <- df %>% mutate(target_bool = case_when(salary == ">50K" ~ TRUE, salary == "<=50K" ~ FALSE))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mutate #ifelse #function
ADD COMMENT
Topic
Name
9+9 =