[R] Grouping

From: Judith Flores <juryef_at_yahoo.com>
Date: Thu, 24 Jan 2008 14:21:05 -0800 (PST)


I need to group some subjects according to two variables (var1, var2)

I have a data frame that looks something like this:

Subject var1 var2

1         400    150         
2         320    100     
3         580    600     
4         145    789     

   

  Each suject would fall into one of 2 categories ('A' or 'B'). I want to find (and see) all the possible combinations of letter assignment that exist, but every combination needs to have an equal amount of subjects categorized as 'A' or 'B'(eg. if I have 20 subjects there should be 10 assigned with letter 'A' and 10 with letter 'B')

Thank you in advance for any hints,

Judith



Never miss a thing. Make Yahoo your home page.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 Jan 2008 - 22:23:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jan 2008 - 13:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive