Hi,

I am wanting to look at frequent item sets using the arules package. I need
to transform my data into a "transactions" object. The data I read in from a
file has 2 columns, an ID and an item. How do I convert data like this into
a transactions object?

I've tried 
class? transactions
but it only confuses me.

My data is like this....
 
basketID        item
1       bread
1       cheese
1       milk
2       bread
2       cheese 
2       eggs
3       bread
3       cheese
3       beer

and from what I gather it should be like this?

 data <- list(
  c("bread","cheese","milk"),
  c("bread","cheese","eggs"),
  c("bread","cheese","beer")
)

so I can use:

t <- as(data, "transactions")

Thanks in advance.

Phil


-- 
View this message in context: 
http://r.789695.n4.nabble.com/transaction-object-how-to-coerce-this-data-tp2402613p2402613.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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