Re: [R] Data indexing issue...

2012-03-27 Thread HJ YAN
Hi Jim! Thank you so much for the very helpful hints!! I am learning 'split' now and it seems very useful.. HJ On Tue, Mar 27, 2012 at 12:58 PM, jim holtman wrote: > Why not use 'split' and get all the groups at once: > > result <- split(Calandra, list(Calandra$Day, Calandra$Season, drop = TRU

Re: [R] Data indexing issue...

2012-03-27 Thread jim holtman
Why not use 'split' and get all the groups at once: result <- split(Calandra, list(Calandra$Day, Calandra$Season, drop = TRUE) On Tue, Mar 27, 2012 at 7:43 AM, Ivan Calandra wrote: > Hi HJ, > > Take a look at ?"&"; this is probably what you're looking for. > > What you could also do is: > Calend

Re: [R] Data indexing issue...

2012-03-27 Thread Ivan Calandra
Hi HJ, Take a look at ?"&"; this is probably what you're looking for. What you could also do is: Calender[Calender$Day=='Wd' & Calender$Season=="Winter", ] # notice the last comma This will subset directly without using which(); it might be helpful to you. HTH, Ivan -- Ivan CALANDRA Univer

[R] Data indexing issue...

2012-03-27 Thread HJ YAN
Dear R-help, My dataset (which is a data frame, called 'Calender' here) includes 365 rows representing 365 days for a year. One column ('Season')contains factor data representing seasons, e.g. spring, summer, autumn and winter. Another column (called 'Day') contains data representing wether the