I am working on a marketbasket analysis with arules in R, my transaction set has transaction id, like in the example.
screen shot of example:
I have a need to search items in the transaction set by transaction id,
like, if I search for 0002
, it should list out all the item related to that transaction id.
if I understood you correctly, and trans1 is a transaction object, you can try:
(Grep will get you all transactions containing the string)
inspect(trans1[grep("0002",trans1@itemsetInfo$transactionID)])
update: To get exact match try:
inspect(trans1[ trans1@itemsetInfo$transactionID=='0002',])