Re: [R] Bar Chart

From: Jim Lemon <>
Date: Thu, 24 Mar 2011 18:01:23 +1100

On 03/24/2011 03:26 AM, blutack wrote:
> How do you do a bar chart of 2 vectors?
> I have one vector which has 10 numbers, and another which has 10 names.
> The numbers are the frequency of the corresponding name, but when I do a bar
> chart it says that there is no height. Thanks.
Hi blutack (any relation to Bluto?),
My guess is that you want the frequencies as the heights of the bars and the names as the labels of the bars:

bar_names<-c("Oliver","Petroushka","Queequag","Rumplestiltskin",   "Sinbad","Tycho","Uranus","Vesalius","Wojtec","Xavier") barplot(heights,names.arg=bar_names)

Whoops! Lost some of the labels:


Jim mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 Mar 2011 - 07:06:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Mar 2011 - 08:40:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive