title: add a logarithmic regression line to a scatterplot (comparison with Excel)
body: <p>In Excel, its pretty easy to fit a logarithmic trend line of a given set of trend line. Just click add trend line and then select &quot;Logarithmic.&quot; Switching to <code>R</code> for more power, I am a bit lost as to which function should one use to generate this.</p>
  <p>To generate the graph, I used <code>ggplot2</code> with the following code.</p>
  <pre><code>ggplot(data, aes(horizon, success)) + geom_line() + geom_area(alpha=0.3)+
    stat_smooth(method='loess')
  </code></pre>
  <p>But the code does local polynomial regression fitting which is based on averaging out numerous small linear regressions. My question is whether there is a similar log trend line in <code>R</code> that is used in Excel.</p>
  <p>Edit: An alternative I am looking for is to get an log equation in form y = (c*ln(x))+b; is there a coef() function to get 'c' and 'b'?</p>
  <p>Edit2: Since I have more reputation, I can now post a bit more about what I am struggling to do. Let my data be:</p>
  <pre><code>0.599885189,0.588404133,0.577784156,0.567164179,0.556257176,0.545350172,0.535112897,
  0.52449292,0.51540375,0.507271336,0.499904325,0.498851894,0.498851894,0.497321087,
  0.4964600,0.495885955,0.494068121,0.492154612,0.490145427,0.486892461,0.482395714,
  0.477229238,0.471010333
  </code></pre>
  <p>The above data are y-points while the x-points are simply integers from 1:length(y) in increment of 1. In Excel: I can simply plot this and add a logarithmic trend line and the result would look:</p>
  <p><img src="https://i.stack.imgur.com/A4x6x.png" alt="enter image description here" /></p>
  <p>With black being the log. In R, how would one do this with the above dataset?</p>