I would like advise on how to code a new column based on the following dataset:
df <- data.frame(AA = c("3454","345","5","345","567","79","43","2342","231","234","232","24"),
BB = c(123, 345, 7567, 234, 8679, 890, 812, 435345, 567, 568, 786, 678),
CC = c(1, 2, 6, 8, 22, 33, 56, 2, 34, 45, 45, 65), stringsAsFactors = F)
and I would like to create a new column called 'new' made out of the following conditions:
Group1 = AA > 300 & BB > 2000 & CC < 5
Group2 = AA ≥ 20 & BB ≤ 700 & CC > 60 but ≤ 70
Thanks!