title: How to fit a smooth curve to my data in R?
body: <p>I'm trying to draw a smooth curve in <code>R</code>. I have the following simple toy data:</p>
  
  <pre><code>&gt; x
   [1]  1  2  3  4  5  6  7  8  9 10
  &gt; y
   [1]  2  4  6  8  7 12 14 16 18 20
  </code></pre>
  
  <p>Now when I plot it with a standard command it looks bumpy and edgy, of course:</p>
  
  <pre><code>&gt; plot(x,y, type='l', lwd=2, col='red')
  </code></pre>
  
  <p>How can I make the curve smooth so that the 3 edges are rounded using estimated values? I know there are many methods to fit a smooth curve but I'm not sure which one would be most appropriate for this type of curve and how you would write it in <code>R</code>. </p>