Re: [R] Need help to convert data frame to transaction set.

2014-04-20 Thread Sathish Kumar
Hi AK, First, your timely response is greatly appreciated. Contrary to what you are getting, I am getting the below when I enter the same code > lines1 <- readLines("spares.csv") > head(lines1) [1] "Cust_ID,Parts""1,FENDERS""2,FENDERS" [4] "3,OIL FILTERS""4,BMW SERVI

Re: [R] Need help to convert data frame to transaction set.

2014-04-20 Thread Sathish Kumar
Hi Arul, Thanks for your reply. I am trying your approach now. I will reply once again with my result. Regards, Sathish On Sat, Apr 19, 2014 at 6:43 PM, arun wrote: > > > Hi, > > Without a reproducible example using ?dput() or the package name, it is a > bit difficult to comment. > > Assumi

Re: [R] Need help to convert data frame to transaction set.

2014-04-19 Thread arun
Hi Satish, Using your code: part<-read.csv("spares.csv") str(part) #'data.frame':    838 obs. of  1 variable: # $ Cust_ID.Parts: Factor w/ 838 levels "100\tAIR\tFILTER\tHOUSING\t",..: 161 333 495 727 728 768 769 770 784 785 ... #I guess you have only two columns in the dataset  lines1 <- read

Re: [R] Need help to convert data frame to transaction set.

2014-04-19 Thread arun
Hi, Without a reproducible example using ?dput() or the package name, it is a bit difficult to comment. Assuming that you used: library(arules)  data("AdultUCI") AdultUCI$ID <- 1:nrow(AdultUCI) lst1 <- split(AdultUCI[,"ID"], AdultUCI[,"marital-status"])  as(lst1, "transactions") #transactions

[R] Need help to convert data frame to transaction set.

2014-04-19 Thread Sathish Kumar
Hi, To convert coerce the data set to transaction data set I used the code trans4 <- as(split(a[,"Cust_ID"], a[,"Parts"]), "transactions") but I am getting the following error- Error in as(split(a[, "Cust_ID"], a[, "Parts"]), "transactions") : nomethod or default for coercing “list” to “transac