📄 truehist.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Plot a Histogram</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 truehist {MASS}"><tr><td>truehist {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Plot a Histogram</h2>
<h3>Description</h3>
<p>
Creates a histogram on the current graphics device.
</p>
<h3>Usage</h3>
<pre>
truehist(data, nbins = "Scott", h, x0 = -h/1000,
breaks, prob = TRUE, xlim = range(breaks),
ymax = max(est), col,
xlab = deparse(substitute(data)), bty = "n", ...)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>data</code></td>
<td>
numeric vector of data for histogram. Missing values (<code>NA</code>s)
are allowed and omitted.
</td></tr>
<tr valign="top"><td><code>nbins</code></td>
<td>
The suggested number of bins. Either a positive integer, or a character string
naming a rule: <code>"Scott"</code> or <code>"Freedman-Diaconis"</code> or <code>"FD"</code>. (Case is
ignored.)
</td></tr>
<tr valign="top"><td><code>h</code></td>
<td>
The bin width, a strictly positive number (takes precedence over <code>nbins</code>).
</td></tr>
<tr valign="top"><td><code>x0</code></td>
<td>
Shift for the bins - the breaks are at <code>x0 + h * (..., -1, 0, 1, ...)</code>
</td></tr>
<tr valign="top"><td><code>breaks</code></td>
<td>
The set of breakpoints to be used. (Usually omitted, takes precedence
over <code>h</code> and <code>nbins</code>).
</td></tr>
<tr valign="top"><td><code>prob</code></td>
<td>
If true (the default) plot a true histogram.
The vertical axis has a
<EM>relative frequency density</EM>
scale, so the product of the dimensions of any panel gives the
relative frequency. Hence the total area under the histogram
is 1 and it is directly comparable with most other estimates
of the probability density function.
If false plot the counts in the bins.
</td></tr>
<tr valign="top"><td><code>xlim</code></td>
<td>
The limits for the x-axis.
</td></tr>
<tr valign="top"><td><code>ymax</code></td>
<td>
The upper limit for the y-axis.
</td></tr>
<tr valign="top"><td><code>col</code></td>
<td>
The colour number for the bar fill.
</td></tr>
<tr valign="top"><td><code>xlab</code></td>
<td>
label for the plot x-axis. By default, this will be the name of <code>data</code>.
</td></tr>
<tr valign="top"><td><code>bty</code></td>
<td>
The box type for the plot - defaults to none.
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
additional arguments to <code><a href="../../graphics/html/rect.html">rect</a></code> or <code><a href="../../Zelig/html/plot.zelig.html">plot</a></code>.
</td></tr>
</table>
<h3>Details</h3>
<p>
This plots a true histogram, a density estimate of total area 1. If
<code>breaks</code> is specified, those breakpoints are used. Otherwise if
<code>h</code> is specified, a regular grid of bins is used with width
<code>h</code>. If neither <code>breaks</code> nor <code>h</code> is specified,
<code>nbins</code> is used to select a suitable <code>h</code>.
</p>
<h3>Side Effects</h3>
<p>
A histogram is plotted on the current device.
</p>
<h3>References</h3>
<p>
Venables, W. N. and Ripley, B. D. (2002)
<EM>Modern Applied Statistics with S.</EM> Fourth edition. Springer.
</p>
<h3>See Also</h3>
<p>
<code><a href="../../xps/html/hist-methods.html">hist</a></code>
</p>
<hr><div align="center">[Package <em>MASS</em> version 7.2-44 <a href="00Index.html">Index]</a></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -