title: Syntax for binomial formula in geom_smooth
body: <p>I have computed a binomial regression in R:</p>
  
  <pre><code>Call:
  glm(formula = cbind(success, failure) ~ x * f, family = "binomial", 
      data = tb1)
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -3.6195  -0.9399  -0.0493   0.5698   2.0677  
  
  Coefficients:
                Estimate Std. Error z value Pr(&gt;|z|)    
  (Intercept) -2.3170182  0.0622600 -37.215  &lt; 2e-16 ***
  x            0.0138201  0.0009892  13.972  &lt; 2e-16 ***
  fTRUE        0.6466238  0.1976115   3.272  0.00107 ** 
  x:fTRUE     -0.0035741  0.0032587  -1.097  0.27273    
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 479.88  on 147  degrees of freedom
  Residual deviance: 201.53  on 144  degrees of freedom
    (7 observations deleted due to missingness)
  AIC: 870.72
  
  Number of Fisher Scoring iterations: 4    
  </code></pre>
  
  <p>and I'd like to visualize it. I would like to plot the data and the regression curve. I can easily get the linear smoother to work:</p>
  
  <pre><code>ggplot(tb1, aes(x, success/(success+failure), colour=f)) +
    geom_point() +
    geom_smooth(method="lm")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rzth0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rzth0.png" alt="Linear Regression"></a></p>
  
  <p>but what I really want is to draw a logistic curve through the data. When I try:</p>
  
  <pre><code>ggplot(tb1, aes(x, success/(success+failure), colour=f)) +
    geom_point() +
    geom_smooth(
      method="glm",
      method.args=list(family="binomial"),
    )
  </code></pre>
  
  <p>I get this graph:</p>
  
  <p><a href="https://i.stack.imgur.com/fRHHH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fRHHH.png" alt="Suspicious binomial regression"></a></p>
  
  <p>which doesn't seem right. The standard errors shouldn't be so large. I thought I'd need to specify the formula explicitly in geom_smooth, but I can't get the syntax right. When I try</p>
  
  <pre><code>ggplot(tb1, aes(x, success/(success+failure), colour=f)) +
    geom_point() +
    geom_smooth(
      method="glm",
      method.args=list(
        family="binomial",
        formula = cbind(success, failure) ~ x
      )
    )
  </code></pre>
  
  <p>I get</p>
  
  <blockquote>
    <p>Warning message:<br>
    Computation failed in <code>stat_smooth()</code>:<br>
    object 'success' not found </p>
  </blockquote>
  
  <p>How do I specify the formula correctly?</p>