0
我想用arules
包練關聯規則挖掘與R. 的數據是無法轉換數據幀的交易對象
datt <- structure(list(Item1 = c(0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L,
0L), Item2 = c(0L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L), Item3 = c(0L,
1L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 0L), Item4 = c(0L, 0L, 0L, 1L,
0L, 0L, 0L, 0L, 0L, 0L), Item5 = c(1L, 0L, 0L, 1L, 0L, 0L, 0L,
0L, 0L, 1L), Item6 = c(0L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 0L
), Item7 = c(0L, 1L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L), Item8 = c(0L,
1L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 0L), Item9 = c(0L, 1L, 1L, 1L,
0L, 0L, 0L, 0L, 1L, 0L), Item10 = c(0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L)), .Names = c("Item1", "Item2", "Item3", "Item4",
"Item5", "Item6", "Item7", "Item8", "Item9", "Item10"), row.names = c(2L,
3L, 4L, 5L, 6L, 8L, 9L, 10L, 11L, 12L), class = c("cast_df",
"data.frame"))
這樣做
table5 <- as(datt, "transactions")
這個錯誤變成了:
Error in as(datt, "transactions") :
no method or default for coercing 「cast_df」 to 「transactions」
我能做些什麼來將我的對象轉換爲「交易」反對呢?
THX在我的電腦您的幫助。但是,有一個與你的way.The錯誤錯誤如下:ERROE:如(as.matrix( datt),「transactions」): 沒有方法或強制將「cast_matrix」強制爲「transactions」 – causjc 2013-04-10 13:28:19