Hi there, May be expand.grid() ?
HTH, Jorge On Thu, Jun 3, 2010 at 5:55 PM, moleps <> wrote: > Dear R“ers, > > > How can I create one single factor variable from two variables > incorporating all possible combinations of the values?? > > > test<-sample(c("A",NA,"B"),100,replace=T) > test2<-sample(c("E",F,"A"),100,replace=T) > > > tes<-cbind(test,test2) > > > pseduocode: > > r<-function(test,test2) > > r > > AE > AF > AA > NAE > NAF > NAA > BE > BF > BA > > > //M > > > > > [[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. > > [[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.