Learn R Programming

adas.utils (version 1.0.0)

pareto_chart.data.frame: Pareto's chart

Description

Create a Pareto chart for a data frame.

Usage

# S3 method for data.frame
pareto_chart(obj, labels, values, ...)

Value

a Pareto chart (GGPlot2 object) of the data frame

Invisibly returns a data frame with the absolute values of the data frame, their sign, and the cumulative value.

Arguments

obj

a data frame

labels

the column with the labels of the data frame

values

the column with the values of the data frame

...

further parameters (currently unused)

Examples

Run this code
library(tibble)
set.seed(1)
tibble(
  val=rnorm(10, sd=5),
  cat=LETTERS[1:length(val)]
  ) %>%
  pareto_chart(labels=cat, values=val)

Run the code above in your browser using DataLab