Hi guys I have data set with Hb values ,I want to find whether they are normal or not. As the refference ranges for each sex differs I want to write down it as conditionally. (If it is a female ,Hb below 12 is low and if male below 13.8 is low). Here is the code I used. This doesnot work
A <- anemia %>% if_else(Sex == "M") %>% mutate(Hb_level=case_when(Hb>13.7~ "Normal",Hb<13.8 ~"Low")), mutate(Hb_level=case_when(Hb>12~ "Normal",Hb<12 ~"Low"))
Please help anyone????