Association Rules
Hi,
I have a table with 2 Columns ID and Product.
I want to Edit the Script in R, but I can't get it to work
How should it be the read.transactions statement?
> txn <- read.transactions(dataset, rm.duplicates= TRUE,format='basket',sep='','',cols =1)
But I get this error...
Error in readLines(file, encoding = encoding) : 'con' is not a connection
Hi,
The function "read.transactions" reads a transaction data file from disk and creates a transactions object. The error you get indicates that R could not open the file for reading.
1) Save your excel as CSV for example to : "c:\\Users\\someone\\Downloads\\try.csv
2) Run
txn <- read.transactions("c:\\Users\\boefraty\\Downloads\\try.csv", rm.duplicates= TRUE,format='single', sep='','',cols =c(2,1))
Beside this, you should make sure that your data is a transaction object: to store a binary incidence matrix, item labels, and optionally transaction IDs and user IDs. Check your format is "single" or "basket"
You are welcome to continue and discuss this example with me via email: [email protected] or here