[R] Barchart, Pareto

From: Kapoor, Bharat <k_at_chicagogsb.edu>
Date: Sun, 09 Dec 2007 02:23:17 -0600


Well I am relatively new so some of these issues may not fall under the subject that I have used.  

  1. How do I do a Pareto. Following is the approach I took.

My data looks like this

   Reaason.for.failure Frequency

1 Phy Conn 1

2 Power failure 3

3 Server software 29

4 Server hardware 2

5 Server out of mem 32

6 Inadequate bandwidth 1  

I modified the data using:
> df <- df2_9[order(df2_9$Frequency,decreasing=TRUE),]
> x$Percent <- 100*(x$Frequency)/(sum(x$Frequency))

  ReasonCode Frequency ROF Percent

5 OOM 32 Out of Momeory 47.058824

3 SS 29 Server Software 42.647059

2 PF 3 Power failure 4.411765

4 SH 2 Server h/w 2.941176

1 PC 1 Physical Conn 1.470588

6 IB 1 Insuff b/w 1.470588  

barplot(x$Percent, space=0, names.arg=x$ReasonCode, main="Pareto", legend.text=x$ReasonCode, ylab="% error")  

Here are my questions:

  1. I could not print the data in ROF column below the bar charts, How to get full labels for each bar insted I createda new coumn ReasonCode just to fit below the bars.
  2. Can I color code each bar differently
  3. How to set limit on the y-axis - by deafult it shows 40, I want it show Y-axis till 50?
  4. How to display value of each bar inside or on top of it?

        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 09 Dec 2007 - 08:29:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 11 Dec 2007 - 13:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.