stat_pareto {ggQC} | R Documentation |
Generate a Pareto Plot with ggplot
Description
stat function to create ggplot Pareto chart
Usage
stat_pareto(mapping = NULL, data = NULL, geom = "point",
position = "identity", show.legend = NA, inherit.aes = TRUE,
group = 1, na.rm = FALSE, point.color = "black", point.size = 2,
line.color = "black", line.size = 0.5, bars.fill = c("red",
"white"), ...)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use display the data |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
group |
defines grouping for variable for pareto plot, default and suggested is 1. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
point.color |
color, used to define point color of cumulative percentage line |
point.size |
number, used to define point size of cumulative percentage line |
line.color |
color, used to define line color of cumulative percentage line |
line.size |
color, used to define line weight of cumulative percentage line |
bars.fill |
character vector length 2, start and end colors for pareto bars. |
... |
Other arguments passed on to |
Value
Pareto plot.
Examples
############################
# Example 1: Pareto Plot #
############################
# Load Libraries ----------------------------------------------------------
require(ggQC)
require(ggplot2)
# Setup Data --------------------------------------------------------------
df <- data.frame(
x = letters[1:10],
y = as.integer(runif(n = 10, min = 0, max=100))
)
# Render Pareto Plot ------------------------------------------------------
ggplot(df, aes(x=x, y=y)) +
stat_pareto(point.color = "red",
point.size = 3,
line.color = "black",
#size.line = 1,
bars.fill = c("blue", "orange"),
)