'Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘itemFrequencyPlot’ for signature ‘"data.frame"’

I cannot understand the reason but when I try to run this code, it gives me an error. Do you know what can be the reason?

library(arules)
library(arulesViz)
library(RColorBrewer)

# import dataset
data("trsf")

# using apriori() function
rules <- apriori(trsf,
                 parameter = list(supp = 0.01, conf = 0.2))

# using inspect() function
inspect(rules[1:10])

# using itemFrequencyPlot() function
arules::itemFrequencyPlot(trsf, topN = 20,
                          col = brewer.pal(8, 'Pastel2'),
                          main = 'Relative Item Frequency Plot',
                          type = "relative",
                          ylab = "Item Frequency (Relative)")**



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source