Thanks to Andy Liaw and Baz
for alternatives to tinkering with plot.formula
to get
plot(cbind(y1,y2) ~ x, ...)
to work.
However...
> From: "Liaw, Andy" <[EMAIL PROTECTED]>
matplot(x, cbind(y1, y2), ...)
> From: Barry Rowlingson <[EMAIL PROTECTED]>
xyplot(y1+y2~x,data=xyy,allow.multiple=T)
The former requires separate code for the case of multiple response variables.
The latter does provide a formula interface, but the interpretation
of the formulae is inconvenient.
For example
- if y1 is an expression containing "+"
then it would have to be protected by I() to prevent the
summands in the expression being plotted separately.
- you can't replace one of the response variables by a constant,
as this will be evaluated as a vector of length 1.
It's a lot easier with cbind() , for example
plot(cbind(z1 -zhat + bias, 0) ~ x)
gets you a plot of (z1-zhat+bias) versus x
together with a horizontal line at y=0.
The idea of using cbind() was indeed modelled on the glm() usage.
----
Adrian Baddeley, Mathematics & Statistics, University of Western Australia
<http://maths.uwa.edu.au/~adrian/>
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help