title: Adding text to the tip of lines in xyplot{lattice}
body: <p>I'm confused as how to add text in <code>xyplot</code>. Given the toy example below, I'd like to add the text <code>"A"</code>, <code>"B"</code>, <code>"C"</code> at the far right of the tips of <code>YA</code>, <code>YB</code>, and <code>YC</code>, respectively. I reformatted my data into a data.frame so it mimics my actual dataset. Any tips are greatly welcome</p>
  
  <pre><code>X = seq(1,100,length.out=5)
  YA = 4*X + 10
  YB = 2*X-5
  YC = 0.5*X + 100
  
  Xs = rep(X,3)
  Y = c(YA,YB,YC)
  index = as.factor(c(rep(1,5),rep(2,5),rep(3,5)))
  Mat = data.frame(index,Xs,Y)
  levels(Mat$index)=c("A","B","C")
  
  xyplot(Y~Xs,data=Mat,group=index,col=c("blue","red","black"),type="l")
  </code></pre>