Basically I have a column with signal strength values (Sig_1) and am making a new column called "Activity2". If the difference between one value and the next (of Sig_1) is equal to or more than 5, I would like an "A" to appear in my new column. If the signal strength is below -130, I would like a "W" to appear and if it is above -130 then I would like an "I".
I have a nested ifelse statement:
df <- transform(df, Activity2 = c(0, ifelse(diff(Sig_1)<5),
ifelse(Sig_1<-130), "W", "I"), "A")
I can't see what's wrong with it but I keep getting:
"Error in ifelse(diff(Sig_1) < 5) :
argument "yes" is missing, with no default"