I am trying to run an association rule model using the apriori algorithm in the R program. I have my data in either txt file format or in csv file format. My data generally looks like this.
a, b, c, d,
e, f, g, h,
i, j, k, l,
(etc.)
The data is usually read into R
read.transactions("Trial.txt")
transactions in sparse format with
138 transactions (rows) and
217 items (columns)
However when I try to run the apriori algorithm, I get an error.
> m1 <- apriori("Trial.txt")
Error in as(data, "transactions") :
no method or default for coercing “character” to “transactions”
I think there is a problem with how I am entering the data into R. I have tried the methods for removing duplicates and this does not appear to work. How should I enter this data into R to run the model?