Question: R graphs without bar
0
gravatar for Parham
4.9 years ago by
Parham1.4k
Sweden
Parham1.4k wrote:

Hi, does anybody know why my R plots graphs without the bar?

I also get the following error:

Error : Mapping a variable to y and also using stat="bin".
  With stat="bin", it will attempt to set the y value to the count of cases in each group.
  This can result in unexpected behavior and will not be allowed in a future version of ggplot2.
  If you want y to represent counts of cases, use stat="bin" and don't map a variable to y
  If you want y to represent values in the data, use stat="identity".
  See ?geom_bar for examples. (Defunct; last used in version 0.9.2)

 

R • 1.4k views
ADD COMMENTlink modified 4.9 years ago by Pierre Lindenbaum121k • written 4.9 years ago by Parham1.4k

To get a better answer, you should provide the code that is throwing this error. In this case it seems like the error message is telling you what to do: read ?geom_bar and decide if stat should be identity or bin (in which case you shouldn't set a y-value)

ADD REPLYlink written 4.9 years ago by David W4.7k
3
gravatar for David Fredman
4.9 years ago by
David Fredman990
University of Bergen, Norway
David Fredman990 wrote:

Not quite Bioinformatics specific, this question. See here for a nice explanation (bar plot vs histogram, and the necessary inputs)

http://stackoverflow.com/questions/15651084/ggplot2-mapping-variable-to-y-and-using-stat-bin

ADD COMMENTlink written 4.9 years ago by David Fredman990

Thanks, but it doesn't help. I don't understand what should I do! 

ADD REPLYlink written 4.9 years ago by Parham1.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1760 users visited in the last hour