title: facet_grid showing composition in percent with ggplot2
body: <p>I'm trying to get a facet-grid of my data-frame.</p>
  
  <p>The purpose is to summarize the composition (in percent) of each clades (A, B, C, D, E, F) for every individuals (n=24).</p>
  
  <p>Also the sum of each clade is not 100%, but ultimately really close to it.
  None of the individuals got Clade B or F.</p>
  
  <p>Here is my R script :</p>
  
  <pre><code>library(scales)
  library(reshape)
  library(ggplot2)
  
  #Add an id variable for the filled regions
  X_clade$ind &lt;- factor(X_clade$ind)
  X_clade$days &lt;- factor(X_clade$days)
  X_clade$temperature &lt;- factor(X_clade$temperature)
  X_clade$D &lt;- NULL
  Clade &lt;- c(X_clade$A, X_clade$B, X_clade$C, X_clade$E, X_clade$F)
  Abundance= 100*cumsum(Clade)/sum(Clade)
  str(X_clade)
  Abundance
  hist(Clade$A)
  
  #subset
  file.29&lt;-X_clade[(X_clade$days == 29),]
  file.65&lt;-X_clade[(X_clade$days == 65),]
  file.53&lt;-X_clade[(X_clade$days == 53),]
  
  #install.packages("wesanderson")
  library(wesanderson)
  plot_bar(X_clade)
  
  file.29$B &lt;- NULL
  file.29$F &lt;- NULL
  seq(0.1,1,by=0.1)
  
  p1&lt;-ggplot(file.29,aes(x = ind, y=Abundance,fill = Clade)) +
    geom_bar(position = "fill",stat = "identity") +    
    scale_y_continuous(labels = percent_format())  +
    theme(panel.background = element_blank(),
          panel.border=element_rect(fill=NA),
          panel.grid.minor = element_blank(),
          axis.text.x=element_text(colour="black",size=11),
          axis.text.y=element_text(colour="black",size=11),
          axis.title =element_blank()) + guides(fill=FALSE) +
    facet_grid(days~temperature,scales="free_x")
  p1
  
  p_1M=ggplot(file.29,aes(x = ind, y=Abundance,fill = Clade)) 
  p_1M
  
  p2&lt;-ggplot(file.53,aes(x = ind, y=Abundance,fill = Clade)) +
    geom_bar(position = "fill",stat = "identity") +  
    scale_y_continuous(labels = percent_format())  +
    theme(panel.background = element_blank(),
          panel.border=element_rect(fill=NA),
          panel.grid.minor = element_blank(),
          strip.text.x = element_blank(),
          axis.text.x=element_text(colour="black",size=11),
          axis.text.y=element_text(colour="black",size=11),
          axis.title =element_blank()) +guides(fill=FALSE) +
    facet_grid(days~temperature,scales="free_x")
  p2
  
  p3&lt;-ggplot(file.65,aes(x = ind, y=Abundance,fill = Clade)) +
    geom_bar(position = "fill",stat = "identity") +  
    scale_y_continuous(labels = percent_format())  +
    theme(panel.background = element_blank(),
          panel.border=element_rect(fill=NA),
          panel.grid.minor = element_blank(),
          strip.text.x = element_blank(),
          axis.text.x=element_text(colour="black",size=11),
          axis.text.y=element_text(colour="black",size=11),
          axis.title =element_blank()) + guides(fill=FALSE) +
    facet_grid(days~temperature,scales="free_x")
  p3
  
  library(gridExtra)
  
  grid.arrange(p1, p2, p3, nrow=3)
  </code></pre>
  
  <p>but for each plot (p1,p2,p3), i get the same error message : Error: Aesthetics must be either length 1 or the same as the data (8): x, y, fill.</p>
  
  <p>Every insight on how to resolve this issue would be lovely ! As I am sure I'm not far away from it. 
  But still, all the way stuck tho !</p>
  
  <p>All my best</p>
  
  <p>Homère</p>