[R] boxplot of subset of factors, in an order of my choice

From: Sumitrajit Dhar <s-dhar_at_northwestern.edu>
Date: Thu 29 Jun 2006 - 23:40:06 EST


Hi Folks,

Say I am working with the following data set: testResults:

	stud		test		score
1	1		fTest	43
2	1		rTest	39
3	1		gTest	43
4	2		fTest	23
5	2		rTest	33
6	2		gTest	41

.
.
.

N n gTest 47

I would like to generate a boxplot of rTest only. Here is what I have done after reading the data in and attaching the object.

test <- factor(test)

Now when I try

boxplot(score ~ test, subset = test=="rTest")

  1. I still see the tick marks for the other factors on the x-axis although no data are plotted. Can I eliminate these extra markers (and the space for these faactors) and just have the tick marker and the label for "rTest"?
  2. I would also like to be able to rearrange the tests as they appear from left to right on the graph. I read the hints and help about reorder.factor but it does not seem to be the solution in this case. I am wanting to re-order the boxes without any logic (statistical anyways). Can this be done?

Thanks in advance,
Sumit



R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 29 23:46:03 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 30 Jun 2006 - 00:12:34 EST.

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