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

Sathish Kumar tellsathish at gmail.com
Sat Apr 19 10:57:55 CEST 2014


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 “transactions”



Then I tried first converting the data set to matrix structure using the
code

c_m<-as.matrix(c_df)
 c_m



then entered the following code


trans2 <- as(c_m, "transactions")

but got the following error

Error in as(c_m, "transactions") : no method or default for coercing
“matrix” to “transactions”
Please let me know how to correct the problem.

Thanks
Sathish


More information about the R-help mailing list