Hello 
I am not sure about your general aim, but from my previous experience on 
combination of treatments, it can be more useful to create a matrix or 
data.frame, which you can fulfill either with 1s and 0s, or with the values of 
treatment, especially if you will need this data later for the analysis. 

I can propose a small function, but only for the case of pair selection 

treat=function(x,y){ 
data.frame(Treatment=x[-which(x==y)], Comparator=rep(y,times=length(x)-1)) 
} 

> treat(c("t1","t2","t3","t4"),"t2") 
Treatment Comparator 
1 t1 t2 
2 t3 t2 
3 t4 t2 

In this case you can define the list of names of treatments ant the comparator 
each time you need, and you will get the result as a data frame in the way you 
asked. 

Good luck 

Alex Levitchi 
PhD in Genetics, 
Bioinformatician at Laboratory of Bioinformatics 
CBM, Area Science Park, Trieste, Italy 
http://www.cbm.fvg.it/laboratories/bioinformatics_research 

scientific researcher, 
Center of Molecular Biology, 
University of Academy of Sciences of Moldova 
www.edu.asm.md 

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to