From: Adrian Baddeley (firstname.lastname@example.org)
Date: Tue 17 Jun 2003 - 20:55:11 EST
Thanks to Andy Liaw and Baz
for alternatives to tinkering with plot.formula
plot(cbind(y1,y2) ~ x, ...)
> From: "Liaw, Andy" <email@example.com>
matplot(x, cbind(y1, y2), ...)
> From: Barry Rowlingson <B.Rowlingson@lancaster.ac.uk>
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.
- 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/>
______________________________________________ Rfirstname.lastname@example.org mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:54 EST