1

Hi I need help with this. When I put

enter image description here

I got these error.

BUT, I'm trying to plotting it on a knit html document and I want something like this:

enter image description here

What should i pass as a parameter to the plot function???

Vzqivan
  • 361
  • 3
  • 6
  • 16

1 Answers1

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

Adjust the height of your graphics device

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

or try using an interactive plot

sel <- plot(rules, method="grouped", interactive=TRUE)
lukeA
  • 53,097
  • 5
  • 97
  • 100
  • 1
    nice function +1, you could also abbreviate the labels, `Groceries <- arulesViz::abbreviate(Groceries)` – Rorschach Jul 22 '15 at 19:41
  • it doesn't work because im trying to plot it on a knit html document :( – Vzqivan Jul 22 '15 at 19:46
  • @IvanG4Life And it's not possible to define the height for a plot there? Please edit your question and provide a minimal reproducible example of what you got. – lukeA Jul 22 '15 at 19:50
  • 1
    @IvanG4Life Replace `\`\`\`{r}` by `\`\`\`{r, fig.height=20}` for example. – lukeA Jul 22 '15 at 20:28