[R] Plotting multiple series of data

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Aug 8 22:14:51 CEST 2001


On Wed, 8 Aug 2001, Jain, Rahul (Rahul) wrote:

> I'd like to plot data that's in the form of a table such as this:
>
> 	1	2	4	6	8	12
> a	10	11	12	14	15	30
> b	2	3	3	4	5	5
> c	1	1	2	2	3	3
>
> Where the row headers are the results for different series of tests, and the
> column headers are the x-values.
>
> I'd like to plot this as a set of lines, one each for "a", "b", and "c". I
> can rearrange the data as needed, but I'm wondering if there's an easy way
> to do this in R. I suppose I could just use gnuplot for this plot if it'll
> be simpler, but I'd like to avoid changing the visual style of the graphs
> just for this set.

matplot(t(table), type="l")

or something similar: you get the idea which is to use matplot to plot
columns.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list