问题
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 include a range of values as a criterion? One out of many codes I tried:
sum(dat2[dat2$happy > 4 & dat2$happy < 8] & dat2$induction == 2)
Tank you so much!
来源:https://stackoverflow.com/questions/65923147/counting-cases-two-conditions-range-of-values