I already found out how to count cases based on two conditions:
sum(dat2$happy > 7 & dat2$induction == 1)
But do you know how I can indlude a range of values as a criteria? One out of many codes I tried:
sum(dat2[dat2$happy > 4 & dat2$happy < 8] & dat2$induction == 2)
Tank you so much!
2.1m questions
2.1m answers
60 comments
57.0k users