title: How to display two groups of boxplots?
body: <p>I have two groups of data (x1 and x2 versus y1 and y2), which I would like to display as two groups of boxplots. </p>
  
  <p>I tried the following, but it displays the wrong data because the vectors x1 and x2 (and y1 and y2) are not of the same lengths:</p>
  
  <pre><code>x1 &lt;- c(2,3,4)
  x2 &lt;- c(0,1,2,3,4,5)
  
  y1 &lt;- c(3,4,5)
  y2 &lt;- c(1,2,3,4,5,6)
  
  d0 &lt;- matrix(c(x1, x2),  ncol=2)
  d1 &lt;- matrix(c(y1, y2),  ncol=2)
  
  lmts &lt;- range(d0,d1)
  
  par(mfrow = c(1, 2))
  boxplot(d0, ylim=lmts, xlab="x")
  boxplot(d1, ylim=lmts, xlab="y")
  </code></pre>
  
  <p>This is what it shows (of course, I wanted the whiskers of the first boxplot to go from 2 to 4 instead, according to the range of x1, etc.):</p>
  
  <p><img src="https://i.stack.imgur.com/xP21m.png" alt="drawn"> </p>