[R] extending subsets over another variable..

John Christie jc at or.psychology.dal.ca
Mon Jun 2 04:53:08 CEST 2003


Hi,
	I've been trying to learn and use R for data analysis, and so far it 
has be OK.  It is very slow with the aov command.  But, other than that 
things are generally OK.	Anyway, todays problem is one that I have 
looked in quite a few places to try to solve but to know avail.  I hope 
the list can help.
	I have my data organized in the appropriate way (i.e. a data point on 
each row and columns for each variable).  I want to divide my subjects 
up by a median.  However, I don't want the overall subject median but a 
subset, and then to split the entire subjects data on that subset.  I 
don't see a way to do that at all.  Any help would be appreciated.

to make things clearer, here is an example of how to split subject by 
median

ss<-split(s, ave(s$x, s$subj) > median(ave(s$x,s$subj)))

what I need to do is split by subject when s is further split by a sub 
factor.

TIA
John Christie




More information about the R-help mailing list