Re: [R] Bar Chart

From: Francisco Gochez <fjgochez_at_googlemail.com>
Date: Wed, 23 Mar 2011 19:00:28 +0000

Hi,

It's difficult to know what is going wrong from what you say below (please include some reproducible code in the future as indicated in the posting guide). If you want to produce a bar chart of the numbers with the corresponding names as labels for these numbers, you can do something like this:

x <- rnorm(10)
y <- letters[1:10] # use the first 10 letters of the alphabet as the labels barplot(x, names.arg = y)

HTH, Francisco

On Wed, Mar 23, 2011 at 4:26 PM, blutack <x-jess-h-x_at_hotmail.co.uk> 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.
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Bar-Chart-tp3399924p3399924.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 Mar 2011 - 20:36:31 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 Wed 23 Mar 2011 - 20:50:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive