How to plot Pareto Chart in R?

Description

How to plot a Pareto Chart using R programming.

Pareto Chart:

   A Pareto chart is a barplot where thecategories are ordered in nonincreasing order

   A line is also added to show thecumulative sum(cumulative sum issimilar to Fibonacci series)

R Package : qcc

R Function :chart()

#Pareto Chart

#Vector Input
x<-c(34,56,23,87,45,87,64,78,566,566)

#Sorting the vector in desending order
input<-sort(x,decreasing = TRUE)
print(input)

#Installing Package needed for pareto chart
#install.packages(“qcc”)
library(“qcc”)

#Pareto Chart
names(input)<-c(“x1″,”x2″,”x3″,”x4″,”x5″,”x6″,”x7″,”x8″,”x9″,”x10″)
pareto.chart(input,main=”ParetoChart”,col=rainbow(length(input)))

Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit