I would like to create a variable ("ogive") to which certain values would be assigned depending on the value of the other variable ("new"). I need to set the intervals using the ifelse function.
I tried doing this and it didn't work
anton$ogive <- ifelse((anton$new >= 109 | anton$new <= 118) == 8,
ifelse(anton$new >= 101 | anton$new <= 108) == 7,
ifelse(anton$new >= 91 | anton$new <= 100) == 6,
ifelse(anton$new >= 82 | anton$new <= 90) == 5,
ifelse(anton$new >= 76 | anton$new <= 81) == 4,
ifelse(anton$new >= 68 | anton$new <= 75) == 3)