title: ggplot2-R Error: stat_count() must not be used with a y aesthetic
body: <p>I have already checked the question below:
  <a href="https://stackoverflow.com/questions/34963138/error-stat-count-in-ggplot2">Error: stat_count() in ggplot2</a>
  Unfortunately, it is not helpful for me.</p>
  
  <p>I have a data frame with 4 columns:
  cutoff, Magnitude (factors)
  TP, SD_TP (variables)</p>
  
  <pre><code>    "CutOff" "Magnitude" "TP" "SD_TP" 
  "1" "60" "1.High Magnitude" "10.915" "0.982211657301897" 
  "2" "120" "1.High Magnitude" "10.094" "1.19439967790961" 
  "3" "180" "1.High Magnitude" "11.152" "0.868129972786132" 
  "4" "210" "1.High Magnitude" "11.35" "0.927556122485513" 
  </code></pre>
  
  <p>(this is just a part of the data frame)</p>
  
  <p>I am using this code:</p>
  
  <pre><code>dodge &lt;- position_dodge(width=0.9)       
   gg &lt;- ggplot(barTP, aes(x=CutOff, y=TP, fill=Magnitude)) +
        theme(plot.title = element_text(size=30))+
        geom_bar(aes(colour = Magnitude))+
        scale_fill_manual(values=c("green", "yellow", "orange","red"))+
        labs(title = TITOLO,size=20)+
        scale_y_continuous(name = "total TPs",breaks = c(0,2,4,6,8,10,12,13), limits = c(-0.5, 14))+
        geom_bar(position=position_dodge(), stat="identity") +
        geom_bar(position=dodge) + geom_errorbar(limits, position=dodge, width=0.25)+
        theme(legend.text=element_text(size=15))+
        theme(legend.title=element_text(size=15))+
        theme(axis.text.x = element_text(colour="gray0",size=15,angle=0,hjust=.5,vjust=.5,face="plain"),
              axis.text.y = element_text(colour="gray0",size=15,angle=0,hjust=1,vjust=0,face="plain"),  
              axis.title.x = element_text(colour="gray0",size=15,angle=0,hjust=.5,vjust=0,face="plain"),
              axis.title.y = element_text(colour="gray0",size=15,angle=90,hjust=.5,vjust=.5,face="plain"))
  </code></pre>
  
  <p>when I plot gg <code>plot(gg)</code> R gives this error alarm</p>
  
  <pre><code>Error: stat_count() must not be used with a y aesthetic.
  </code></pre>
  
  <p>the strange thing is that two days ago it worked! Now, also with the same data frame, it does not work.</p>
  
  <p>I have changed nothing in the code. I have just shared the code with another PC by dropbox. But I do not think it would be the reason.</p>
  
  <p>After the suggestions of @aosmith, I put <code>stat = "identity"</code>in each <code>geom_bar</code>.
  It worked only after I uploaded R to the version 3.2.5 ("Very, Very Secure Dishes") and installed again <code>ggplot2</code>.</p>
  
  <pre><code> gg &lt;- ggplot(barTP, aes(x=CutOff, y=TP, fill=Magnitude)) +
     theme(plot.title = element_text(size=30))+
     geom_bar(aes(colour = Magnitude),stat="identity")+
     scale_fill_manual(values=c("green", "yellow", "orange","red"))+
     labs(title = TITOLO,size=20)+
     scale_y_continuous(name = "total TPs",breaks = c(0,2,4,6,8,10,12), limits = c(-0.5, 14))+
     geom_bar(position=position_dodge(), stat="identity") +
     geom_bar(position=dodge, stat="identity") + 
     geom_errorbar(limits, position=dodge, width=0.25,stat="identity")+
     theme(legend.text=element_text(size=15))+
     theme(legend.title=element_text(size=15))+
     theme(axis.text.x = element_text(colour="gray0",size=15,angle=0,hjust=.5,vjust=.5,face="plain"),
          axis.text.y = element_text(colour="gray0",size=15,angle=0,hjust=1,vjust=0,face="plain"),  
          axis.title.x = element_text(colour="gray0",size=15,angle=0,hjust=.5,vjust=0,face="plain"),
          axis.title.y = element_text(colour="gray0",size=15,angle=90,hjust=.5,vjust=.5,face="plain"))
  
   plot(gg)
  </code></pre>
  
  <p>But now, the plot is different than in the past.<a href="https://i.stack.imgur.com/9x0sx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9x0sx.png" alt="enter image description here"></a>
  In the picture, you can see a green background. In the previous ones, there were not the "big" green bars. I have understood that the green background is the barplot of the "high Magnitude" values. I am not understanding how to modify it now.</p>
  
  <p>How is it possible that with new versions there so many problems? is something that I am doing wrong?</p>