Problem

You want to create a Pareto Chart in Sisense from a collection of numbers that represent frequencies (or counts) of events or outcomes that fall into different categories.

Alt text

Solution

counts<-c(do.call('cbind',args));
t<-data.frame(counts);
id<-as.numeric(rownames(t));
t<-cbind(id=id,t);
t<-t[order(t$counts, decreasing=T),];
total <- sum(t$counts);
cumulative_precentage<-function(c){return(c/total)};
sisense_resut <-sapply(t$counts, cumulative_precentage);
t<-cbind(t,sisense_resut);
t$sisense_resut<-cumsum(t$sisense_resut);
t<-t[order(t$id),];
t$sisense_resut

Alt text

Discussion

A Pareto Chart is a sorted bar chart that displays the frequency (or count) of occurrences that fall in different categories, from greatest frequency on the left to least frequency on the right, with an overlaid line chart that plots the cumulative percentage ofoccurrences. The vertical axis on the left of the chart shows frequency (or count), and the vertical axis on the right of the chart shows the cumulative percentage.

A ParetoChart is typically used to visualize:

The Pareto Chart is typically used to separate the “vital few” from the “trivial many” using the Pareto principle, also called the 80/20 Rule, which asserts that approximately 80% of effects come from 20% of causes for many systems. Pareto analysis can thus be used to find, for example, the most critical types or sources of defects, the most common complaints that customers have, or the most essential categories within which to focus problem-solving efforts.

References

https://en.wikipedia.org/wiki/Pareto_chart/

http://www.r-bloggers.com/pareto-charts-in-r/

http://www.inside-r.org/packages/cran/qcc/docs/pareto.chart/