[R] Plotting a graph of many lines between groups of points...
th50 at leicester.ac.uk
Wed Jul 16 10:41:22 CEST 2003
Assuming your variables are called V1 to V4, and are vectors,
I'd use something like
Research Associate in Medical Statistics
University of Leicester
Department of Epidemiology and Public Health
22-28 Princess Road West
Tel +44 116 252-5410
Fax +44 116 252-5423
Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Tel +44 116 256-3643
Fax +44 116 232-2976
> -----Original Message-----
> From: Andrew Johnson [mailto:johnson.2060 at osu.edu]
> Sent: 15 July 2003 20:42
> To: r-help at stat.math.ethz.ch
> Subject: [R] Plotting a graph of many lines between groups of
> I have a data file read into a data frame.
> For example,
> V1 V2 V3 V4
> 1 1 1 3 4
> 2 2 3 5 10
> . . . . .
> . . . . .
> n V1[n] V2[n] V3[n] V4[n]
> to n=many thousand
> I want to plot a graph with many line segments, where
> v1[i]=x1, v2[i]=y1,
> v3[i]=x2, v4[i]=y2 for i=1,n.
> This seems relatively simple in theory but I've spent quite a
> bit of time
> trying to make it happen with plot(type=), points(x,y), or
> lines(x,y) to no
> Do I need to turn these into vectors before plotting them?
> Any help would be greatly appreciated.
> R-help at stat.math.ethz.ch mailing list
More information about the R-help