[R-sig-eco] Line Plot from a subset of a data frame

bpdilla padilla.31 at buckeyemail.osu.edu
Mon Feb 13 23:01:11 CET 2012


Hi. 

I have a data frame with two sets of variables, one continuous Distance
variable, the other a correlation response variable.  I also have a column
that contains an ordinal variable of three types - here is an example.   

   DISTANCE Mantel.r SPECIES Site.Type Migratory.Status 
1   0.00000  0.14121    ACFL       ALL          MIGRANT 
2  12.22267  0.07678    ACFL       ALL          MIGRANT 
3  18.70522 -0.17162    ACFL       ALL          MIGRANT 
4  24.18015 -0.12109    ACFL       ALL          MIGRANT 
5  34.60731  0.11119    ACFL       ALL          MIGRANT 
6   0.00000 -0.72777    ACFL     RURAL          MIGRANT 
7   5.12862 -0.33734    ACFL     RURAL          MIGRANT 
8   5.65393  0.07193    ACFL     RURAL          MIGRANT 
9  32.73115  0.01347    ACFL     RURAL          MIGRANT 
10 36.31511  0.08692    ACFL     RURAL          MIGRANT 
11  0.00000  0.47739    ACFL     URBAN          MIGRANT 
12  2.31889  0.25079    ACFL     URBAN          MIGRANT 
13  3.75088  0.04259    ACFL     URBAN          MIGRANT 
14 11.94983  0.06237    ACFL     URBAN          MIGRANT 
15 14.24218 -0.14643    ACFL     URBAN          MIGRANT 

I want to make a line plot for each species (ACFL is one of 16 species I
have) that contains three lines, one for ALL, RURAL, and URBAN.  What is the
best way that I can do this without creating a subset for each group?  For
example, would I have to create 
#### 
ALL=subset(acfl,acfl$Site.Type=='ALL') 
##and then## 
plot(ALL$DISTANCE,ALL$Mantel.r,type='o') 


I would love some help!  Thanks.   

Ben 

--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/Line-Plot-from-a-subset-of-a-data-frame-tp7282081p7282093.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



More information about the R-sig-ecology mailing list