0

I'm trying to understand how to use arules to do some association for work. I've got some dummy data and I've written this in R Studio as follows:

sales_list <- split(sales$ProductName, paste(sales$SalesOrderID))

My table sales contains 2 pieces of data - product name and the salesorder

However, when I've tried to split it out into a dataframe its turning into one big list. It just appears to be a list and I cant attempt to do any association rules on this.

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Gemma
  • 1
  • 1
  • A more common use of the `split` function would be e.g. `sales_list <- split(sales, sales$SalesOrderID)`. But I have no idea what you are trying to achieve. – Axeman Mar 06 '20 at 23:11
  • I’m trying to do some basic association rules to find frequent item sets. I’m really new to r so I’ve been stumbling around trying to get the data into a format to play with and I keep drawing a blank – Gemma Mar 06 '20 at 23:19
  • 1
    Does this answer your question? [how to convert data.frame to transactions for arules](https://stackoverflow.com/questions/17313450/how-to-convert-data-frame-to-transactions-for-arules) – Weihuang Wong Mar 07 '20 at 00:00

0 Answers0