<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I see what you mean now. You are lucky I did this kind of plot in
one of my previous assignment. I have modified the data to suit your
needs. The data is directly quoted from the paper <b>475.340 Designs
of Surveys and Experiments </b>in the University of Auckland, New Zealand.
<p># Enter the data, count.
<br>count <- c( 11, 14, 15, 17, 18, 21, 25,
<br> 39, 43, 46, 50, 52, 61, 67,
<br> 88, 92, 104, 113, 119, 120, 130,
<br> 222, 251, 259, 283, 299, 312, 337,
<br> 562,,604, 689, 702, 710, 739, 786 )
<p># Enter the ordered factor, Test.
<br># Since the data, count, is kind of like a 7 by 5 matrix, you need
to
<br># repeat Test 1 ~ Test 5 by that amount.
<br># In other words, "Test" will look something like:
<br> # 1 1 1 1 1 1 1
<br> # 2 2 2 2 2 2 2
<br> # 3 3 3 3 3 3 3
<br> # 4 4 4 4 4 4 4
<br> # 5 5 5 5 5 5 5
<br>Test <- ordered( factor( rep( c( 1, 2, 3, 4, 5 ),
<br> rep( 7, 5 )
<br> )
<br>
)
<br>
)
<br>
<p># To draw a boxplot that has Test 1 ~ Test 5 on its x-axis and
<br># count on its y-axis.
<br># There should be 5 box&whiskers within the SAME plot box.
<br>boxplot( split( count, Test ),
<br> xlab = "Test", ylab
= "counts",
<br> main = "A Boxplot"
)
<p>To make is easier for you, I have even saved it as an R source file
and attached it below for you. Just saved it to your disk, use "source()"
function in R to source it in directly. From the R commands, it should
be pretty easy to see how you should change it to get the plot that you
want. (The # means R comments, it will NOT affect the plots).
<p>Cheers,
<p>Ko-Kang Wang
<p>Christine Serres wrote:
<blockquote TYPE=CITE>First of all, I thanks you all for replying me .
<br>I've not asked my question in good terms, so I've made a little drawing
<br>of what I want to do in my boxplot : - )
<p>| -
-
<br>| |
|
<br>| ----
----
<br>| | |
| |
<br>| | 2 |
| 2 |
<br>| ----
----
<br>| |
|
<br>| -
-
<br>|
<br>|
<br>| -
-
<br>| |
|
<br>| ----
----
<br>| |
|
| |
<br>| | 1 |
| 1 |
<br>| ----
----
<br>| |
|
<br>| -
-
<br>|
<br>____________________________________________________________________
<p> Test X
Test Y
<p>(I don't want my boxes to be shifted for the same Test value
because I
<br>know that boxplot 1 and 2 don't overlap)
<br>I'm not sure that the boxplot function can do that.
<br>But perhaps someone know a trick to help me.
<p>Thanks
<br>Christine
<p>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
<br>r-help mailing list -- Read <a href="http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html">http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html</a>
<br>Send "info", "help", or "[un]subscribe"
<br>(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
<br>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._</blockquote>
</html>