[R] extension to plot.formula?

About this list Date view Thread view Subject view Author view Attachment view

From: Adrian Baddeley (adrian@asteridia.maths.uwa.edu.au)
Date: Mon 16 Jun 2003 - 19:52:38 EST


Message-id: <16109.37734.908035.71883@asteridia.maths.uwa.edu.au>

Could I suggest the following extension to plot.formula:

      plot(cbind(y1,y2) ~ x, ...)

should plot (y1 against x) and (y2 against x) on the same plot.

The default y axis limits would be determined by the range of c(y1,y2).

This would be pretty handy sometimes, replacing 4 lines of code.

The current plot.formula evaluates cbind(y1,y2), which is a matrix,
so plot.formula looks for "plot.matrix", in vain, then calls plot.default
which gives an error because length(cbind(y1,y2)) is greater than length(x).

I suggest that plot.formula be changed to recognise the situation where
there is more than one response variable, and produce multiple
superimposed plots in that case. (It already recognises the case
where there are multiple non-response variables).

----
Adrian Baddeley, Mathematics & Statistics, University of Western Australia
		<http://maths.uwa.edu.au/~adrian/>

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:54 EST