DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
9+9 =
Submit