Description Usage Arguments Details Value Note Author(s) References See Also Examples
Produces an empirical probability density function plot.
1 2 3 4 5 
x 
numeric vector of observations. Missing ( 
discrete 
logical scalar indicating whether the assumed parent distribution of 
density.arg.list 
list with arguments to the 
plot.it 
logical scalar indicating whether to produce a plot or add to the current plot (see 
add 
logical scalar indicating whether to add the empirical pdf to the current plot
( 
epdf.col 
a numeric scalar or character string determining the color of the empirical pdf
line or points. The default value is 
epdf.lwd 
a numeric scalar determining the width of the empirical pdf line.
The default value is 
epdf.lty 
a numeric scalar determining the line type of the empirical pdf line.
The default value is 
curve.fill 
a logical scalar indicating whether to fill in the area below the empirical pdf
curve with the
color specified by 
curve.fill.col 
a numeric scalar or character string indicating what color to use to fill in the
area below the empirical pdf curve. The default value is

type, main, xlab, ylab, xlim, ylim, ... 
additional graphical parameters (see 
When a distribution is discrete and can only take on a finite number of values,
the empirical pdf plot is the same as the standard relative frequency histogram;
that is, each bar of the histogram represents the proportion of the sample
equal to that particular number (or category). When a distribution is continuous,
the function epdfPlot
calls the R function density
to
compute the estimated probability density at a number of evenly spaced points
between the minimum and maximum values.
epdfPlot
invisibly returns a list with the following components:
x 
numeric vector of ordered quantiles. 
f.x 
numeric vector of the associated estimated values of the pdf. 
An empirical probability density function (epdf) plot is a graphical tool that can be used in conjunction with other graphical tools such as histograms and boxplots to assess the characteristics of a set of data.
Steven P. Millard ([email protected])
Chambers, J.M., W.S. Cleveland, B. Kleiner, and P.A. Tukey. (1983). Graphical Methods for Data Analysis. Duxbury Press, Boston, MA.
See the REFERENCES section in the help file for density
.
Empirical, pdfPlot
, ecdfPlot
,
cdfPlot
, cdfCompare
, qqPlot
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  # Using Reference Area TcCB data in EPA.94b.tccb.df,
# create a histogram of the logtransformed observations,
# then superimpose the empirical pdf plot.
dev.new()
log.TcCB < with(EPA.94b.tccb.df, log(TcCB[Area == "Reference"]))
hist(log.TcCB, freq = FALSE, xlim = c(2, 1),
col = "cyan", xlab = "log [ TcCB (ppb) ]",
ylab = "Relative Frequency",
main = "Reference Area TcCB with Empirical PDF")
epdfPlot(log.TcCB, add = TRUE)
#==========
# Generate 20 observations from a Poisson distribution with
# parameter lambda = 10, and plot the empirical PDF.
set.seed(875)
x < rpois(20, lambda = 10)
dev.new()
epdfPlot(x, discrete = TRUE)
#==========
# Clean up
#
rm(log.TcCB, x)
graphics.off()

Attaching package: 'EnvStats'
The following objects are masked from 'package:stats':
predict, predict.lm
The following object is masked from 'package:base':
print.default
dev.new(): using pdf(file="Rplots1.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.