itemfrequencyplot.html

来自「本程序是基于linux系统下c++代码」· HTML 代码 · 共 147 行

HTML
147
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Creating a Item Frequencies/Support Bar Plot</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for itemFrequencyPlot {arules}"><tr><td>itemFrequencyPlot {arules}</td><td align="right">R Documentation</td></tr></table>
<h2>Creating a Item Frequencies/Support Bar Plot</h2>


<h3>Description</h3>

<p>
Provides the generic function <code>itemFrequencyPlot</code> and the S4 method to
create an item frequency bar plot for inspecting the item frequency
distribution for objects based on <code><a href="itemMatrix-class.html">itemMatrix</a></code> (e.g.,
<code><a href="transactions-class.html">transactions</a></code>, or items in <code><a href="itemsets-class.html">itemsets</a></code>
and <code><a href="rules-class.html">rules</a></code>).
</p>


<h3>Usage</h3>

<pre>
itemFrequencyPlot(x, ...)
## S4 method for signature 'itemMatrix':
itemFrequencyPlot(x, type = c("relative", "absolute"), 
    support = NULL, topN = NULL,
    population = NULL, popCol = "black", popLwd = 1,
    lift = FALSE, horiz = FALSE, 
    names = TRUE, cex.names =  par("cex.axis"), 
    xlab = NULL, ylab = NULL, mai = NULL, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
the object to be plotted.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
further arguments are passed on (see  
<code><a href="../../graphics/html/barplot.html">barplot</a></code> from possible arguments).</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
a character string indicating whether 
item frequencies should be displayed 
relative of absolute.</td></tr>
<tr valign="top"><td><code>support</code></td>
<td>
a numeric value. Only display items which have a support of 
at least <code>support</code>. If no population is given, support is calculated 
from <code>x</code> otherwise from the population. Support is interpreted relative
or absolute according to the setting of <code>type</code>.</td></tr>
<tr valign="top"><td><code>topN</code></td>
<td>
a integer value. Only plot the <code>topN</code> 
items with the highest item frequency or lift (if <code>lift = TRUE</code>).
The items are plotted ordered by descending support. </td></tr>
<tr valign="top"><td><code>population</code></td>
<td>
object of same class  as <code>x</code>; if <code>x</code>
is a segment of a population, the population mean frequency for
each item can be shown as a line in the plot.</td></tr>
<tr valign="top"><td><code>popCol</code></td>
<td>
plotting color for population.</td></tr>
<tr valign="top"><td><code>popLwd</code></td>
<td>
line width for population.</td></tr>
<tr valign="top"><td><code>lift</code></td>
<td>
a logical indicating whether to plot the lift ratio between
instead of frequencies. The lift ratio is gives how many times an item is
more frequent in <code>x</code> than in <code>population</code>.</td></tr>
<tr valign="top"><td><code>horiz</code></td>
<td>
a logical. If <code>horiz = FALSE</code> (default), 
the bars are drawn vertically. If <code>TRUE</code>, the bars are
drawn horizontally.</td></tr>
<tr valign="top"><td><code>names</code></td>
<td>
a logical indicating if the names (bar labels) should be 
displayed?</td></tr>
<tr valign="top"><td><code>cex.names</code></td>
<td>
a numeric value for the expansion factor for axis names (bar
labels).</td></tr>
<tr valign="top"><td><code>xlab</code></td>
<td>
a character string with the label for the x axis 
(use an empty string to force no label).</td></tr>
<tr valign="top"><td><code>ylab</code></td>
<td>
a character string with the label for the y axis (see xlab).</td></tr>
<tr valign="top"><td><code>mai</code></td>
<td>
a numerical vector giving the plots margin sizes in inches (see `? par').</td></tr>
</table>

<h3>Value</h3>

<p>
A numeric vector with the midpoints of the drawn bars; useful for
adding to the graph.</p>

<h3>See Also</h3>

<p>
<code><a href="itemFrequency.html">itemFrequency</a></code>,
<code><a href="itemMatrix-class.html">itemMatrix-class</a></code>
</p>


<h3>Examples</h3>

<pre>
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 &lt;- Adult[Adult %in% 
        "income=large"]

## simple plot
itemFrequencyPlot(Adult.largeIncome)

## plot with the averages of the population plotted as a line 
## (for first 72 variables/items)
itemFrequencyPlot(Adult.largeIncome[, 1:72], 
        population = Adult[, 1:72])

## plot lift ratio (frequency in x / frequency in population)
## for items with a support of 20% in the population
itemFrequencyPlot(Adult.largeIncome, 
        population = Adult, support = 0.2, 
        lift = TRUE, horiz = TRUE)
</pre>



<hr><div align="center">[Package <em>arules</em> version 0.6-6 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?