Re: [R] Question about Factors

2009-09-14 Thread Don MacQueen
The suggestions from others to use lattice's xyplot, or ggplot2 are good. If you want an explicit loop you can do something like: for ( nm in unique(mydat$Name) ) { with( subset( mydf, Name==nm) , { plot(Time, Value, title=nm) readline('CR to continue ') } ) } At 5:19

Re: [R] Question about Factors

2009-09-13 Thread Schalk Heunis
On Mon, Sep 14, 2009 at 5:19 AM, Schalk Heunis wrote: > Chris > try this (assume your dataset is in a dataframe called ms): > library(lattice) > xyplot(Value~Time|Name,data = ms) > > HTH > Schalk > > > > On Mon, Sep 14, 2009 at 2:19 AM, Chris Li wrote: > >> >> Hi all, >> >> I am new to R and I hav

Re: [R] Question about Factors

2009-09-13 Thread cls59
Chris Li wrote: > > Hi all, > > I am new to R and I have got a question in regards to factors. > > Say I have a simple dataset like the following: > > Name Time Value > a 1:00 1.25 > a 2:00 1.26 > b 1:00 1.29 > b 2:00 1.28 > c 1:0

[R] Question about Factors

2009-09-13 Thread Chris Li
Hi all, I am new to R and I have got a question in regards to factors. Say I have a simple dataset like the following: Name Time Value a 1:00 1.25 a 2:00 1.26 b 1:00 1.29 b 2:00 1.28 c 1:00 1.21 c 1:30 1.20 c