title: Creating violin plots on ggplot2 for vectors of different length?
body: <p>I have two vectors of different length, and want to create a violin plots for them. What I am currently doing is to <code>cbind</code> them, which makes the shorter vector to be repeated until it matches the length of the longer vector (by default done by <code>cbind</code> in R).</p>
  
  <pre><code>library(ggplot2)
  
  C1 &lt;- rnorm(100)
  C2 &lt;- rnorm(500)
  
  dat &lt;- cbind(C1,C2)
  
  # Violin plots for columns
  mat &lt;- reshape2::melt(data.frame(dat), id.vars = NULL)
  pp &lt;- ggplot(mat, aes(x = variable, y = value)) + geom_violin(scale="width",adjust = 1,width = 0.5,fill = "gray80")
  pp
  </code></pre>
  
  <p>Would this affect the shape of the violin?  Is there a more correct way of creating the violin plots without having to artificially increase the length of one of them?</p>