What I want to do is to make a single line plot and then when the Att
value change to the other factor, then the line plot change the color. All in the same line plot. As an example I have the following data frame:
Att <- as.factor(rep(1:3,each = 10))
x <- rnorm(30)
df <- cbind(Att, x)
I´ve tried with this code:
plot(df[,2], typ = "l", col = Att)
but I didn´t have the result that I want it.
Any suggestions?