Phân tích giỏ hàng trong R
Christopher Bruffaerts
Statistician
| TID | Giao dịch |
|---|---|
| 1 | {Bread, Butter, Cheese, Wine} |
| 2 | {Bread, Butter, Wine} |
| 3 | {Bread, Butter} |
| 4 | {Butter, Cheese, Wine} |
| 5 | {Butter, Cheese} |
| 6 | {Cheese, Wine} |
| 7 | {Butter, Wine} |
Biểu đồ tần suất mặt hàng

Kiểu tuyệt đối
itemFrequencyPlot(data_trx,
main='Absolute Item Frequency Plot',
type="absolute"
)
Kiểu tương đối
itemFrequencyPlot(data_trx,
main='Relative Item Frequency Plot',
type="relative"
)


Sắp xếp và lọc với topN
itemFrequencyPlot(
data_trx,
topN = 4,
main = 'Absolute Item Frequency Plot',
type = "absolute"
)

Lật ngang & tùy chỉnh biểu đồ
itemFrequencyPlot(
data_trx,
topN = 4,
main = 'Absolute Item Frequency Plot',
type = "absolute",
col = rainbow(4),
ylab = "",
cex.names = 1.2,
horiz = TRUE
)

Phân tích giỏ hàng trong R