My code are showed as follows:
read.table(\"GO.txt\",header=T,sep=\',\')->go
library(lattice)
barchart(go[,1]~go[,2],horiz=F,ylim=c(30,29666),
layout=c(1,1),s
"Lattice" took your factor variables and arranged them in default (alphabetical) order. You can change the order. Perhaps:
go[,2] <- factor( go[,2] unique(as.character(go[,2])) )
This should set the levels in the same order as they would first appear if you were paging through them. Another equivalent, although more Baroque, assignment would be:
go[,2] <- factor( go[,2] as.character( go[,2][!duplicated(go[,2])]) )
Then do your plot. (I did not attempt to input your data. They looked to be too messy. Well, actually I did give it a shot with tabs as the separator. If they once had tabs. then they lost them, and there are variable numbers of elements if white-space is the separator.)
Using the data in the duplicate question the labels are not sorted:
go[[2]] <- factor(go[[2]], levels=unique(as.character(go[[2]])))