ggplot changing colors of bar plot
<p>I came across this R script that use ggplot:</p>
<pre><code>dat &lt;- read.table(text = &quot;A   B   C   D   E   F    G
1 480 780 431 295 670 360  190
2 720 350 377 255 340 615  345
3 460 480 179 560  60 735 1260
4 220 240 876 789 820 100   75&quot;, header = TRUE)

library(reshape2)

dat$row &lt;- seq_len(nrow(dat))
dat2 &lt;- melt(dat, id.vars = &quot;row&quot;)

library(ggplot2)

ggplot(dat2, aes(x=variable, y=value, fill=row)) + 
  geom_bar(stat=&quot;identity&quot;) +
  xlab(&quot;\nType&quot;) +
  ylab(&quot;Time\n&quot;) +
  guides(fill=FALSE) +
  theme_bw()
</code></pre>
<p>That was what I've been looking for. However, I could not:</p>
<ol>
<li><p>change the default colours (for example, I tried to use the &quot;RdYlGn&quot;
palette)</p>
</li>
<li><p>convert the raw values to frequencies.</p>
<p>Any suggestions?</p>
</li>
</ol>