title: R ggplot2: Color grouped barplot based on condition / numerical thresholds
body: <p>I have the following input for a grouped bar plot that I generate with ggplot2:</p>
  
  <pre><code>Disease;Category;Value;pValue
  Disease A;Count;100;0.0001
  Disease A;Expected Count;50;0.0001
  Disease B;Count;80;0.0005
  Disease B;Expected Count;40;0.0005
  Disease C;Count;60;0.0010
  Disease C;Expected Count;40;0.0010
  Disease D;Count;45;0.05
  Disease D;Expected Count;50;0.05
  </code></pre>
  
  <p>The following code generates the grouped barplot:</p>
  
  <pre><code>literature.disease2 &lt;- read.table(file = "/user/literature-disease2.csv",sep=";", header=TRUE)
  literature.disease2.sorted &lt;- literature.disease2[order(literature.disease2$pValue,literature.disease2$Category),]
  ggplot(data=literature.disease2.sorted, aes(x=Disease, y=Value, fill=Category)) +
  geom_bar(stat="identity", position=position_dodge(),size=.3, colour="black") +
    scale_fill_manual(values=c("Count" = "lightblue", "Expected Count" = "pink")) + # Change color
    xlab("Disease Category") + ylab("Literature Count") + # Set axis labels
    ggtitle("Genome-Wide Literature Counts") +     # Set title
    theme_bw() +
    theme(axis.text.x = element_text(angle =90, hjust = 1,vjust=0.5)) 
  </code></pre>
  
  <p>This is the plot:
  <a href="https://i.stack.imgur.com/fBMvE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fBMvE.png" alt="enter image description here"></a></p>
  
  <p><em>Now I would like to color the bars in blue (instead of light blue) and purple (instead of pink) whenever the pValue &lt;= 0.005. I know that I have to change the <strong>scale_fill_manual</strong> option, but I do not know how to do this for grouped bar plots. Can anyone help?</em></p>
  
  <p>Thanks in advance, Frank</p>