title: sm.density.compare(): displaying multiple density estimations in a single plot
body: <p>I am trying to overlay three different density plots in R to create one plot displaying all three lines (superimpose). I have the <code>sm</code> package installed/loaded but I have tried using it with my data to no avail. 
  I created three individual data plots simply using <code>density()</code> and plotting the values. My code looks like this:</p>
  
  <pre><code>library(sm)
  
  set.seed(0)
  x &lt;- rnorm(100, 0, 1)
  y &lt;- rnorm(126, 0.3, 1.2)
  z &lt;- rnorm(93, -0.5, 0.7)
  dx &lt;- density(x)
  dy &lt;- density(y)
  dz &lt;- density(z)
  
  plot(dx)
  plot(dy)
  plot(dz)
  </code></pre>
  
  <p>But when I try using the <code>sm.density.compare()</code> to overlay the graphs:</p>
  
  <pre><code>sm.density.compare(dx,dy,model="equal")
  </code></pre>
  
  <p>I get an error that says:</p>
  
  <blockquote>
    <p>Error in sm.density.compare(dx, dy, model = "equal") :<br>
    sm.density.compare can handle only 1-d data trace:</p>
  </blockquote>
  
  <p>Anyone know how I can fix this? I've researched quite a lot but with no success. I am fairly new to R and could really use the help.</p>