Re: [R] Hmisc xYplot: two ablines?

From: Michael Kubovy <kubovy_at_virginia.edu>
Date: Wed 11 Jan 2006 - 06:17:28 EST

To r-help:

Thanks to Mat Soukup for the help:

To draw two ablines:

xYplot(lo ~ vaR, groups = v, data = abc.fp, aspect = "xy", col = c
("red","blue"),

```	xlab=expression(frac(abs( bold(v) ),abs( bold(a) ))),
ylab = grid::textGrob(expression(paste(log, frac( italic(p) ( italic

(v) ), italic(p) ( italic(a) )))) ),

panel=function(x,y,...){
panel.xYplot(x, y, ...)
panel.abline(a = 7.985090, b= -7.985090, col = "red")
panel.abline(a = 7.926507, b = -7.926507, col = "blue", lty = 2)
}
```

)

This is (to me) a surprising syntactic leap from one abline in xYplot, which can be requested without writing a panel function:

xYplot(lo ~ vaR, groups = v, data = abc.fp, aspect = "xy", col = c
("red","blue"),

```	xlab=expression(frac(abs( bold(v) ),abs( bold(a) ))),
ylab = grid::textGrob(expression(paste(log, frac( italic(p) ( italic

(v) ), italic(p) ( italic(a) )))) ),

panel.abline(a = 7.985090, b= -7.985090, col = "red")
```
)

Professor Michael Kubovy
University of Virginia
Department of Psychology
```USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall