Skip to content
Prev 245793 / 398502 Next

package "arules" - 'transpose' of the transactions

Hi Kohleth,
This is not the transpose. The data structure you want can be created 
this way:

 > l <- LIST(tran)
 > single <- data.frame(ID=rep(names(l), lapply(l, length)), 
items=unlist(l), row.names=NULL)
 > single
       ID  items
1 trans1 item80
2 trans2  item8
3 trans2 item20
4 trans3 item28
The method above should be very fast.

-Michael