Multiple ablines in xyplot
问题 I have a "long" dataframe defined as: q <- data.frame(Indicator.Code=factor(),Year=numeric(),Value=numeric()) and am trying to plot in a single xyplot the values as a function of the year, for each different Indicator.Code , as follows xyplot( Value~Year,data=q,group=Indicator.Code) So far, so good. Now I am trying to add lines corresponding to the linear regressions rlm(q$Value[q$Indicator.Code==a]~q$Year[q$Indicator.Code==a]) for all the values of Indicator.Code . I do not know how to do it