Row order in plot
Then yes, you can do something like I originally suggested, though there are other possible approaches. Making up fake data rather than typing yours in:
testdata <- as.data.frame(matrix(1:15, ncol=3))
testdata <- cbind(c("D", "E", "A", "C", "B"), testdata)
colnames(testdata) <- c("X", "c1", "c2", "c3")
testdata$X <- as.character(testdata$X)
testdata
X c1 c2 c3 1 D 1 6 11 2 E 2 7 12 3 A 3 8 13 4 C 4 9 14 5 B 5 10 15
plot(1:nrow(testdata), testdata$c1, xaxt="n") axis(1, at=1:nrow(testdata), labels=testdata$X)
Gives what I think you want. Sarah
On Thu, Dec 11, 2008 at 3:12 PM, qroberts <lvaickus at bu.edu> wrote:
This is the format of the table as it appears in R
mice
X Green.1 Yellow.2 Blue.3 Gray.4
1 Base 469.5399 508.1532 487.1443 492.2544
2 PBS 459.6553 474.0124 417.2651 392.9518
3 25 Mch 359.6216 418.0417 377.7020 394.2102
4 50 Mch 206.1835 262.8818 252.8041 172.0568
5 Ext. 287.4200 279.8562 287.3744 236.5091
I have been plotting Green.1 vs X as follows
plot(Green.1~X,data=mice)
The order on the x axis is alphabetical e.g 25 Mch, 50 Mch, Base, Ext., PBS
When I would like it to be : Base, PBS, 25 Mch, 50 Mch, Ext. like in the
table.
Sarah Goslee http://www.functionaldiversity.org