title: Having problems with nonlinear regression in ggplot
body: <pre><code>attenuation = data.frame(km =      
  c(0,0,0.4,0.4,0.8,0.8,1.2,1.2,1.6,1.6,2,2,2.4,2.4,2.8,2.8,3.2,3.2,3.6,3.6,4, 
  4,4.4,4.4,4.8,4.8,5.2,5.2,5.6,5.6,6,6,6.4,6.4,6.8,6.8,7.2,7.2,7.6,7.6,8,8, 
  11.7,11.7,13,13), edna = c(76000,20000,0,0,6000,0,0,6880,10700,0,6000,
  0,0,0,0,0,0,6000,0,0,0,0,0,0,0,0,6310,0,6000,6000,0,0,0,0,0,
  0,0,0,0,0,0,6000,0,0,0,0))
  
  #This worked great for a linear regression
  ggplot(attenuation, aes(x = km, y = edna)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  xlab("Distance from Cage (km)") +
  ylab("eDNA concentration (gene sequence/Liter)")
  </code></pre>
  
  <p>But the linear regression doesn't seem to be a good fit (r squared =0.09). So I'd like to try something else.  I tried some other regressions also with poor fits, so I'd like to try a nonlinear regression. </p>
  
  <p>I have researched this question on stack overflow and tried a number of different options, but nothing is working. The option I provide below makes the most sense-but I wonder if I have the formula wrong? Or if the start list needs to be modified? </p>
  
  <p>For context I am trying to explore the relationship between river distance and concentration.</p>
  
  <pre><code>#This is not working for a nonlinear regression
  ggplot(attenuation, aes(x = km, y = edna))+ 
  geom_point() + 
  stat_smooth(method = 'nls', formula = 'y~a*x^b', method.args=list (start = 
  list(a = 1,b=1), se=FALSE))
  </code></pre>
  
  <p>I get the following error from r when I run the code for nls above
     Computation failed in <code>stat_smooth()</code>:
     variable lengths differ (found for '(se)') </p>