title: R: ggplot. Axis labels in a boxplot for loop
body: <p>I am using a for loop to create multiple box plots for a large dataset I have (320269 observables of 170 variables).</p>
  
  <p>For this I am using the following code to generate the boxplots:</p>
  
  <pre><code>nm &lt;- names(data)
  for (i in 1:(ncol(data)-1)){
  print(ggplot(data,aes(as.factor(data$Month),data[c(i)],color=as.factor(data$Month),aes_string("Month",nm[i])))
   + geom_boxplot(outlier.colour="black",outlier.shape=16,outlier.size=1,notch=FALSE))}
  </code></pre>
  
  <p>The graphs are printed in pdf and the boxplot itself comes out correctly, but something goes wrong with the axis labels.
  No matter what I try, I get the x-axis label: <code>as.factor(data$Month)</code>, and on the y-axis: <code>data[c(i)]</code>, instead of "Month" on the x-axis and the actual column-names from the dataset on the y-axis.</p>
  
  <p>What am I missing?</p>
  
  <p>Your help is much appreciated.</p>