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

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 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>