[R] Gettting barchart titles as numbers not characters

Elizabeth Webb e.c.webb97 at leeds.ac.uk
Thu Jun 26 14:55:12 CEST 2008


Hi, I wonder if you could help me with my barcharts, I am using the  
barchart function from the lattice library.

I have data like this:
Complex,Organisms,Percentage
130,0,50
130,1,10
130,2,20
130,3,15
130,4,5
133,0,10
133,1,15
133,2,20
133,3,50
133,4,5

I draw barcharts using this command...
barchart(Percentage~Organisms|Complex,data=data,layout=c(1,2),col=rainbow(5),box.ratio=3,horizontal=FALSE,xlim=c(" 0 "," 1 "," 2 "," 3 "," 4  
"),ylim=c(1,100),xlab="")

But I can't get the title for each graph with the titles "130" and  
"133". The same was for the xlim, so I cheated by using spaces so it  
thinks it is a character string not a number. If you know the proper  
way to do this, that would be great to know too. One last thing, the  
title comes up in a pink row above each barchart - any way to make  
this look a little more exciting? i.e. change colour, align to the  
left??

Many thanks

Liz



More information about the R-help mailing list