[R] ggplot2-Problem (plot different variables)

From: David Studer <studerov_at_gmail.com>
Date: Fri, 20 Apr 2012 10:31:29 +0200


Hi everyone!

I have the following difficulties using ggplot2

# My Data
data<-as.data.frame(cbind(a=c(1,1,2,2,2,2,3,3,4), b=c(1,2,3,3,4,4,4,4,4)))

And I would like to plot the frequency-distributions of both variables in one plot as lines. For both variables the values (1-4) should be on the x-axys
and the frequency on the y-axis.

I have already found out, that this should work (somehow) using stat_summary()

Can anyone help me?

library(ggplot2)
p<-ggplot(data=data, aes(a,b) )
p+stat_summary(??)

Thank you very much for help!
David

        [[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 Fri 20 Apr 2012 - 08:34:17 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Fri 20 Apr 2012 - 09:00:29 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