ItemfrequencyPlot - Arules包显示底部频率项目集

时间:2015-06-01 12:01:14

标签: r arules market-basket-analysis

我想查看交易数据中的底部频率项,我怎么看?

的代码:

a_list <- list(
c("a","b","c"),    
c("a","b"),
c("a","b","d"),
c("c","e"),
c("a","b","d","e")
)

trans <- as(a_list, "transactions")

itemFrequencyPlot(trans)

PS:我正在将它整合到一个闪亮的平台上。

1 个答案:

答案 0 :(得分:1)

您可以使用itemFrequency()然后对您喜欢的频率进行排序或过滤,并使用barplot()进行绘制。

R> barplot(sort(itemFrequency(trans), decreasing=TRUE))