title: add a curve that fits the peaks from a plot in R?
body: <p>Is there a function that adds a curve that fits the peaks if given two vectors and their plot?
  For example, I have:</p>
  
  <blockquote>
    <p>x= c(0:20)</p>
    
    <p>x
     [1]  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20</p>
    
    <p>y
     [1] 19.4 17.9  8.1 11.3  7.8  8.0  5.0  1.7  3.9  5.4  7.5  5.4  4.7  5.0  4.9  3.5  2.9  2.4  1.4  1.7</p>
    
    <p>plot(x,y,xlim=range(x),ylim=range(y))</p>
  </blockquote>
  
  <p>best,
  Nanami</p>