Re: [R] Histogram/Bar plot graph

From: Senthil Kumar M <senthil.debian_at_gmail.com>
Date: Wed, 6 Feb 2008 02:45:48 -0800

On Feb 6, 2008 2:35 AM, ONKELINX, Thierry <Thierry.ONKELINX_at_inbo.be> wrote:
> You'll need to transform your dataset in a long format first.
>
> library(ggplot2)
> n <- 5
> MyValues <- data.frame(Gene = factor(LETTERS[seq_len(n)]), ES =
> rnorm(n), MEF = rnorm(n), Embrio = rnorm(n), EShyp = rnorm(n))
> MyValuesMelt <- melt(MyValues, id.var = "Gene")
> ggplot(MyValuesMelt, aes(x = Gene, y = value, fill = variable)) +
> geom_bar(position = "dodge")
> ggplot(MyValuesMelt, aes(x = Gene, y = value)) + geom_bar(position =
> "dodge") + facet_grid(. ~ variable)
>

Hi Thierry,
Splendid! It is exactly what I wanted.
Now, I am actually studying your reply to understand what those commands *actually* do.

Thanks a lot,
Sincerely Yours,
Senthil



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 06 Feb 2008 - 10:47:56 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 06 Feb 2008 - 11:30:12 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