Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206235

I need to create a new variable in my dataset. it is defined by conditions of two existing variables in r

$
0
0

this is what i have

total2 %>%
  mutate(happiness = case_when(GDP > 17300 ~ "happy",
                               Mortality < 29 ~ "happy"))

and this is the mistake

‘<’ not meaningful for factors

Any help appreciated


Viewing all articles
Browse latest Browse all 206235

Trending Articles