Learn R Programming

qcc (version 2.6)

pareto.chart: Pareto chart

Description

Plot a Pareto chart.

Usage

pareto.chart(x, ylab = "Frequency", ylab2 = "Cumulative Percentage", xlab, cumperc = seq(0, 100, by = 25), ylim, main, col = heat.colors(length(x)), plot = TRUE, ...)

Arguments

x
a vector of values. names(x) are used for labelling the bars.
ylab
a string specifying the label for the y-axis.
ylab2
a string specifying the label for the second y-axis on the right side.
xlab
a string specifying the label for the x-axis.
cumperc
a vector of percentage values to be used as tickmarks for the second y-axis on the right side.
ylim
a numeric vector specifying the limits for the y-axis.
main
a string specifying the main title to appear on the plot.
col
a value for the color, a vector of colors, or a palette for the bars. See the help for colors and palette.
plot
a logical specifying if a chart should be provided (TRUE, default) or simply a summary table should be returned.
...
other graphical arguments to be passed to the barplot function.

Value

Details

A Pareto chart is a barplot where the categories are ordered in non increasing order, and a line is also added to show the cumulative sum.

References

Mason, R.L. and Young, J.C. (2002) Multivariate Statistical Process Control with Industrial Applications, SIAM. Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons. Ryan, T. P. (2000), Statistical Methods for Quality Improvement, 2nd ed. New York: John Wiley & Sons, Inc. Scrucca, L. (2004). qcc: an R package for quality control charting and statistical process control. R News 4/1, 11-17. Wetherill, G.B. and Brown, D.W. (1991) Statistical Process Control. New York: Chapman & Hall.

See Also

barplot

Examples

Run this code
defect <- c(80, 27, 66, 94, 33)
names(defect) <- c("price code", "schedule date", "supplier code", "contact num.", "part num.")
pareto.chart(defect, ylab = "Error frequency")
pareto.chart(defect, ylab = "Error frequency", xlab = "Error causes", las=1)
pareto.chart(defect, ylab = "Error frequency", col=rainbow(length(defect)))
pareto.chart(defect, cumperc = seq(0, 100, by = 5), ylab2 = "A finer tickmarks grid")

Run the code above in your browser using DataLab