R:放大交易情节

时间:2015-07-22 18:57:14

标签: r plot transactions data-mining arules

嗨,我需要帮助。当我把

enter image description here

我收到了这些错误。

但是,我正在尝试将它绘制在一个编织的HTML文档上,我想要这样的东西:

enter image description here

我应该将什么作为参数传递给绘图函数???

1 个答案:

答案 0 :(得分:1)

library(arulesViz)
data("Groceries")
rules <- apriori(Groceries, parameter=list(support=0.001, confidence=0.5))

调整图形设备的高度

f <- function(height) { 
  pdf(tf <- tempfile(fileext = ".pdf"), height = height)  
  plot(rules, method="grouped") 
  dev.off() 
  shell.exec(tf) 
}
f(5)  # too small
f(10) # better height

或尝试使用交互式情节

sel <- plot(rules, method="grouped", interactive=TRUE)