Dear All, I have a dataframe made up of individual beetles consisting of individual number, family number, mother's family number, father's family number, and sex of the beetle. I would like to pair up the individuals for breeding. I would, however, like to avoid breeding beetles of the same sex (obviously), the same family, and with the same mother's family or father's family, to avoid inbreeding.
The pairs of the beetles can be done with the function combn(individual, 2). I have been trying to use the FUN argument of combn by reducing the options for combn for each individual by negating the rows that share the same sex, family, and parents' families, but I have had no success. Is there an easy way to package all of this into a function for the combn FUN argument, or is there an alternative way of doing this? Many thanks in anticipation, Ben Jarrett -- View this message in context: http://r.789695.n4.nabble.com/pairing-data-using-combn-with-criteria-tp4649750.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@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.