[R] lattice graph with segments (erroneously posted earlier)

Ruud H. Koning info at rhkoning.com
Sat Dec 4 20:56:04 CET 2004


Hello, I have a dataset with three numerical variables, and two factor
variables, one of which is shown:

> deel1[,1:4]
      median       ucl       lcl coupon.period
1  10.894672        NA 14.255623      fixed0-1
5  12.536729 11.658164 13.341038      fixed1-5
9  10.616561  9.979676 11.039264      fixed5-7
13  8.457571  8.048390  8.723679     fixed7-10
17  7.537831  7.274149  7.895592    fixed10-15
21  4.392874  4.279858  4.586663   fixed15more

Think of the data as six regression coefficients, with an upper and lower
confidence limit. I would like to make a lattice plot, with the factor
(fixed0-1,fixed1-5, etc) on the vertical axis, and the median on the
horizontal axis. This is simple: 

xyplot(coupon.period ~ median,data=prepayment,
 panel=function(x,y,...){
  panel.xyplot(x,y)
 }
)

does the trick. Now I want to have a line extending from the dots
representing the median, that run from the median to upper/lower confidence
limit. How do pass the information of deel1$ucl and deel1$lcl to the panel
function, and how do I make segments within the panel function?
Thanks for any help, Ruud




More information about the R-help mailing list