itemFrequencyPlot {arules} | R Documentation |
Provides the generic function itemFrequencyPlot
and the S4 method
to create an item frequency bar plot for inspecting
the item frequency distribution for objects based on
itemMatrix
(e.g.,
transactions
,
or items in
itemsets
and
rules
).
itemFrequencyPlot(x, ...) ## S4 method for signature 'itemMatrix': itemFrequencyPlot(x, type = "relative", population = NULL, deviation = FALSE, horiz = FALSE, cex.names = par("cex.axis"), xlab = NULL, ylab = NULL, mai = NULL, ...)
x |
the object to be plotted. |
... |
further arguments are passed on (see
barplot from possible arguments). |
type |
a character string indicating whether item frequencies should be displayed relative of absolute. |
population |
object of same class as x ; if x
is a segment of a population, the population mean frequency for
each item can be shown as a line in the plot. |
deviation |
"logical" ; plot the relative deviation from the
population mean instead of frequencies. |
horiz |
"logical" ; If FALSE (default),
the bars are drawn vertically. If TRUE , the bars are
drawn horizontally. |
cex.names |
"numeric" ; expansion factor for axis names (bar labels). |
xlab |
a character string with the label for the x axis (use an empty string to force no label). |
ylab |
a character string with the label for the y axis (see xlab). |
mai |
a numerical vector giving the plots margin sizes in inches (see `? par'). |
A numeric vector with the midpoints of the drawn bars; useful for adding to the graph.
data(Adult) # the following example compares the item frequencies # of people with a large income (boxes) with the average in the data set Adult.largeIncome <- Adult[Adult %in% "income=large"] # simple plot itemFrequencyPlot(Adult.largeIncome) # plot with the averages of the population plotted as a line # (first 72 variables/items) itemFrequencyPlot(Adult.largeIncome[, 1:72], population = Adult[, 1:72]) # plot of deviations from population mean (horizontal bars) itemFrequencyPlot(Adult.largeIncome[, 1:72], population = Adult[, 1:72], deviation = TRUE, horiz = TRUE)