Color barplot in R based on a fixed scale
<p>I have a dataframe in R with three columns, <code>label</code> indicates the x-axis label, <code>values</code> would indicate the bar height for a barplot, and and a <code>color</code> value. For instance:</p>

<pre><code>    label     value       color
1  Label1 0.9645477 0.434680035
2  Label2 1.0816859 0.070992644
3  Label3 1.0043559 0.923586653
4  Label4 1.0065987 0.884469520
5  Label5        NA          NA
6  Label6 0.9537397 0.307786218
</code></pre>

<p>I'd like to make a bar plot of the values where the bars are colored by the value in the color column. The color column always ranges from 0 to 1 and I'd like to make discrete colors, on a green to red spectrum, for bins <code>0-0.05, 0-0.1, etc.</code> And then I'd like to have a legend associated with the barplot. For the cases of NA, I'd like there to just be an empty spot on the plot with no bar.</p>

<p>How would I do this?</p>