[R] Plotting by Group

Adrian Hordyk Adrianh at netspace.net.au
Thu Oct 14 06:12:30 CEST 2010


Hi all,

My apologies if this is a very simple problem.  I am very new to R, 
having worked a lot previously with Excel.  I recently completed a R 
course with John Hoenig which introduced me to R.

My data:

X        Y            Species             Group
0           0            A                        1
.            .             A                        1
.            .             A                        1
.            .             A                        1
.            .             A                        1
.            .             A                        1
99           1             A                        1
0            0             B                        1
.            .             B                        1
.            .             B                        1
.            .             B                        1
99            1            B                        1
etc      etc           etc                      etc
with variable numbers between 0 and 99 and 0 and 1 for each species.  I 
have about 30 different species, each catergorised as 1 of 3 groups.

I want to plot X vs Y for each species onto the same plot, using lines. 
   In other words, I need 30 different lines each plotted between 0 and 
1 on the x axis and 0 and 100 on the y, but
they need to be grouped by the Species, otherwise the lines return from 
100 to 0 at the end of the data from each species.

Any help would be greatly appreciated,

Thanks

-- 
Adrian Hordyk

PhD Candidate
Centre for Fish and Fisheries
Biological Sciences and Biotechnology
Murdoch University

Phone: (08) 93606520
Mobile: 0438113583
Email: A.Hordyk at Murdoch.edu.au



More information about the R-help mailing list