title: Changing colour schemes between facets
body: <p>I have a <code>data.frame</code>, something like the following:</p>
  
  <pre><code>set.seed(100)
  
  df &lt;- data.frame(year = rep(2011:2014, 3), 
                   class = rep(c("high", "middle", "low"), each = 4), 
                   age_group = rep(1:3, each = 4), 
                   value = sample(1:2, 12, rep = TRUE))
  </code></pre>
  
  <p>and I am looking to produce, by <code>facet</code>-ing (by the variable <code>age_group</code>) three plots which look similar to those produced by the following code:</p>
  
  <pre><code>library(ggplot2)
  blue &lt;- c("#bdc9e1", "#74a9cf", "#0570b0")
  ggplot(df) + geom_bar(aes(x = year, y = value, 
                            fill = factor(class, levels = c("high", "middle", "low"))), 
                        stat = "identity") + 
    scale_fill_manual(values = c(blue)) +
    guides(fill = FALSE)
  </code></pre>
  
  <p>however, where each facet has a different colour scheme where all the colours are specified by myself.</p>
  
  <p>I appear to want a more specific version of what is going on here: <a href="https://stackoverflow.com/questions/34043312/ggplot2-change-color-for-each-facet-in-bar-chart">ggplot2: Change color for each facet in bar chart</a></p>
  
  <p>So, using the data I have provided, I am looking to get three facet-ed plots, split by <code>age_group</code> where the fill is given in each plot by the level of <code>class</code>, and all colours (9 total) would be specified manually by myself.</p>
  
  <p>Edit: For clarification, the facet that I would like to end up with is indeed provided by the following code:</p>
  
  <pre><code>ggplot(df) + geom_bar(aes(x = year, y = value, 
                            fill = factor(class, levels = c("high", "middle", "low"))), 
                        stat = "identity") + 
    scale_fill_manual(values = c(blue)) +
    guides(fill = FALSE) + 
    facet_wrap(~ age_group)
  </code></pre>
  
  <p>with the added level of control of colour subset by the <code>class</code> variable.</p>