[R] How about a mascot for R?
Andrew Robinson
andrewr at uidaho.edu
Sat Dec 4 21:11:38 CET 2004
Ruud,
try something like the following (not debugged, no coffee yet):
xyplot(coupon.period ~ median, data=prepayment,
subscripts=T,
panel=function(x,y,subscripts,...){
panel.xyplot(x,y)
panel.segments(deel1$lcl[subscripts], deel$ucl[subscripts])
}
)
I hope that this helps,
Andrew
On Sat, Dec 04, 2004 at 08:43:47PM +0100, Ruud H. Koning wrote:
> 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
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
Andrew Robinson Ph: 208 885 7115
Department of Forest Resources Fa: 208 885 6226
University of Idaho E : andrewr at uidaho.edu
PO Box 441133 W : http://www.uidaho.edu/~andrewr
Moscow ID 83843 Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.
More information about the R-help
mailing list