[R] pairing data using combn with criteria

benjamin_jarrett bjmjarrett at gmail.com
Sat Nov 17 19:07:05 CET 2012


Hi David,

Thanks for replying. Unfortunately I can't get it to work. Here is some
(very simplified) data to help illustrate my problem.

ind <- c('1','2','3','4')
fam <- c('1','2','1','2')
data <- data.frame(ind,fam)

ind is the unique ID for each individual, and fam is which family the
individual came from. Using combn(ind, 2) matches all of the individuals. Is
there any way I could get combn to pair individuals up based on a different
family number, so with the above data individual 1 would be paired with
individual 2 or 4. 

Many thanks,

Ben



--
View this message in context: http://r.789695.n4.nabble.com/pairing-data-using-combn-with-criteria-tp4649750p4649869.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list