Description Usage Arguments Value Examples
View source: R/04_stat_pareto.r
stat function to create ggplot Pareto chart
| 1 2 3 4 5 | 
| 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  | 
Pareto plot.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ############################
#  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"),
 )
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.