library(arules)library(Matrix)library(arules)library(arulesViz)library(grid)library(arulesViz)data('SunBai')summary(SunBai)#inspect函数查看SunBai数据集的前5次买卖记录inspect(SunBai[1:5])#itemFrequency()函数可以查看商品的买卖比例itemFrequency(SunBai[,1:3])#support=0.1,表示支持度至少为0.1itemFrequencyPlot(SunBai,support=0.1)#topN=20,表示支持度排在前20的商品itemFrequencyPlot(SunBai,topN=20)#利用transactionInfo函数查看前六数据head(transactionInfo(SunBai))
1