I need to create a variable that characterizes individuals as been "increased", "decreased" or "no change" using the number values in 2 columns. I've tried but I was only able to output the change. How do I include "no change" into the subset and add labels to the values. For example if time1 > time 2 I want R to output "increase" or "decrease" if time1 < time2 and no change if the values don't change. This is what I've done so far but I'm a bit lost.
change<-c(ifelse(a1$time1 > a1$time2, "increase", "decrease" | a1$time==a1$time2, "no change")