Re: [R] making chains from pairs

2013-11-10 Thread arun
Hi, May be this helps.  But, the conditions are not very clear. lst1 - lapply(split(test,test$V1),function(x) unique(as.vector(t(x indx - unlist(lapply(lst1,function(x) which(names(lst1) %in% x))) lst2 - split(gsub(\\d+,,names(indx)),indx) indx1 -

Re: [R] making chains from pairs

2013-11-09 Thread David Winsemius
On Nov 8, 2013, at 10:56 AM, Hermann Norpois wrote: Hello, having a data frame like test with pairs of characters I would like to create chains. For instance from the pairs A/B and B/I you get the vector A B I. It is like jumping from one pair to the next related pair. So for my example

[R] making chains from pairs

2013-11-08 Thread Hermann Norpois
Hello, having a data frame like test with pairs of characters I would like to create chains. For instance from the pairs A/B and B/I you get the vector A B I. It is like jumping from one pair to the next related pair. So for my example test you should get: A B F G H I C F I K D L M N O P test