paretoChart: Pareto chart

View source: R/paretochart.R

paretoChartR Documentation

Pareto chart

Description

Computes a table of statistics and plot a Pareto chart.

Usage

paretoChart(data, ...)

## S3 method for class 'paretoChart'
plot(x, title, xlab, 
     ylab = "Frequency", ylab2 = "Cumulative percentage", 
     ylim, col = blues.colors(nlevels), ...) 

Arguments

data

a vector of values. names(data) are used for labelling the bars.

plot

a logical specifying if the chart should be provided (TRUE, default).

x

an object of class 'paretoChart' returned by a call to paretoChart() function.

title

a character string specifying the main title. Set title = NULL to remove the title.

xlab

a string specifying the label for the x-axis.

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.

ylim

a numeric vector specifying the limits for the y-axis.

col

a value for the color, a vector of colors, or a palette for the bars. See the help for colors and palette.

...

catch other optional arguments.

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.

Value

Returns an object of class 'paretoChart' containing the descriptive statistics used to draw the Pareto chart. This object has associated a print and plot method.

Author(s)

Luca Scrucca

References

Mason, R.L. and Young, J.C. (2002) Multivariate Statistical Process Control with Industrial Applications, SIAM.

Montgomery, D.C. (2013) Introduction to Statistical Quality Control, 7th ed. New York: John Wiley & Sons.

Ryan, T. P. (2011), Statistical Methods for Quality Improvement, 3rd 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

defect <- c(80, 27, 66, 94, 33)
names(defect) <- c("price code", "schedule date", "supplier code", "contact num.", "part num.")
pc = paretoChart(defect, ylab = "Error frequency")
pc
plot(pc)

plot(paretoChart(defect, ylab = "Error frequency"), col=rainbow(length(defect)))

luca-scr/qcc documentation built on Feb. 25, 2023, 3:33 p.m.