Skip to content
Prev 43581 / 398513 Next

Order in barchart

I think you misunderstand what barchart does.  It expects a formula, not a 
named vector, as its first argument.

nm <- names(T3)
z <- factor(nm, levels=nm)
barchart(z ~ T3, xlab="Mean Values", col="dark blue")

is probably what you are looking for.  The factor z is constructed to be 
in the order you want.

That barchart() accepts a named vector appears to be undocumented.  For an 
unnamed vector it does not behave similarly to barplot().
On Mon, 2 Feb 2004, Bliese, Paul D MAJ USAMH wrote: