I am trying to find association rules using arules package in R. I am using a csv file to create the transaction object. I am getting an incorrect item set.
This is what the data looks like
137,lidocaine
138,pregabalin
139,esomeprazole,nadolol,atorvastatin
140,hydromorphone
141,ondansetron,enoxaparin,metoclopramide
142,fluticasone
143,trandolapril,amlodipine,fluticasone,esomeprazole
144,meloxicam
145,lidocaine
146,atorvastatin
147,fluticasone
here is the R code I am using
library("arules")
txn <- read.transactions("basket.csv", rm.duplicates= TRUE,format="basket",sep=",",cols =1);
txn@itemInfo
The item list I am getting has repeated items
labels
1 amlodipine
2 atorvastatin"
3 enoxaparin
4 esomeprazole
5 esomeprazole"
6 fluticasone
7 fluticasone"
8 hydromorphone"
9 lidocaine"
10 meloxicam"
11 metoclopramide"
12 nadolol
13 ondansetron
14 pregabalin"
15 trandolapril
If you look at item 4&5 they are same but are being treated different due to quotation marks, similar case for item 6&7.
Is there a way to resolve this or any reason why is this happening?