title: ddply and ggplot - generating no plot
body: <p>I have a data which is given below:</p>
  
  <pre><code>&gt; dput(qq)
  structure(list(SIC = c(50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 
  50, 50, 50, 50, 50, 50, 50, 50, 50, 50), AVGAT = c(380.251, 391.3885, 
  421.72, 431.83, 483.715, 600.0715, 698.5945, 733.814, 721.426, 
  706.0265, 698.41, 697.9565, 720.761, 855.5245, 1023.226, 1214.8215, 
  1369.7605, 1439.2765, 1602.3845, 1949.69), ADA = c(0.0223312309851002, 
  0.00984600086327487, 0.0199212814576842, 0.0562291585405388, 
  0.0155376903911516, 0.0195296616004618, 0.00650206622557842, 
  0.0295510054117198, 0.0471091745681615, 0.0898164879903691, 0.154998113255882, 
  0.0347106350470676, 0.109407241662021, 0.057428893735577, 0.0637457846236655, 
  0.0584883505633773, 0.0439293152619417, 0.030699982198924, 0.00900414418496609, 
  0.0293862740698763), NLEAD = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), .Names = c("SIC", "AVGAT", "ADA", 
  "NLEAD"), row.names = c(NA, 20L), class = "data.frame")
  </code></pre>
  
  <p>When I run the following code, the code doesn't plot anything:</p>
  
  <pre><code>clusmypath &lt;- file.path("C:", "Users", "Swordfish", "Dropbox", "aaa.pdf");
  pdf(file = clusmypath);
  library(ggplot2);
  ww &lt;- ddply(qq, .(SIC), function(p){ggplot(p,aes(x=AVGAT,y= ADA, color = NLEAD)) + geom_point(shape=1) ;return(p)});
  dev.off();
  </code></pre>
  
  <p>However, when I plot the full data :</p>
  
  <pre><code>clusmypath &lt;- file.path("C:", "Users", "Swordfish", "Dropbox", "aaa.pdf");
  pdf(file = clusmypath);
  library(ggplot2);
  ggplot(qq, aes(x = AVGAT, y = ADA, color = NLEAD)) + geom_point(shape=1)  
  dev.off();
  </code></pre>
  
  <p>I get a plot. How can I make ddply part to work? Thanks.</p>