[R] help needed with boxplot

Jim Lemon jim at bitwrit.com.au
Wed Mar 24 22:49:05 CET 2010


Oops! I sent before attaching the code.

On 03/25/2010 06:03 AM, kathy_BJ wrote:
>
>
> Jim, I really appreciate your hlep. You almost solve my problem, I had tried
> both of your suggestions, but both of them only solve part of problem, and
> how can I combine their functions? your second sample can't give the axis
> (like 0-20, 20-50 etc), btw, we don't have "plotrix" function on our
> machine.

That's okay, I have rewritten the x axis tick labelling so that you 
don't have to use staxlab. That's why you didn't get the axis labels.

> What I want looks like the second plot from
> http://www.statmethods.net/graphs/boxplot.html,

Great! We finally have an example of what you want.

> I want to compare the MB between the two dataset, so the first/third/fifth
> box should from file1(MB) with same color (black), second/fourth/sixth box
> from file2(MB) with same color(red). Of course, the first (black) box and
> second(red) box share the same data range (eg 0-20), and so on for other
> group of box.
>
The attached code does this for the values in the made-up data that have 
col5 equal to RED (in your original post you indicated that you wanted 
to separate these colors). You will probably want to change this 
somewhat, but it is what I understand by the example and your 
explanation above.

Jim
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kbj1.R
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100325/3742556c/attachment.pl>


More information about the R-help mailing list