title: Trying to Add Loess Smoothing Curve to Scatterplot
body: <p>I am trying to add a loess smoothed fit curve to my scatterplot in R. I can't seem to figure out what's wrong with my code below...For reference, the variables <code>poverty</code> and <code>binge_all</code> are column names of a the data frame <code>correlational_data</code>. I have loaded the <code>ggplot2</code> package/library. </p>
  
  <pre><code>library(ggplot2)    
  
  p &lt;- ggplot(correlational_data, aes(poverty, binge_all))
  p &lt;- p + geom_point(color = "blue")
  p &lt;- p + geom_smooth(method = "loess")
  p
  </code></pre>
  
  <p>I used <code>sapply(correlational_data$poverty, class)</code> and <code>sapply(correlational_data$binge_all, class)</code> to determine that <code>poverty</code> and <code>binge_all</code> are of class factor. Not sure if that makes a difference. </p>
  
  <p><strong>Update to show first 10 rows of data</strong></p>
  
  <pre><code>head(correlational_data, 10)
     year                state binge_all poverty
  1  2012              Alabama      12.3      19
  2  2012               Alaska      16.8    10.1
  3  2012              Arizona      15.3    18.7
  4  2012             Arkansas      11.8    19.8
  5  2012           California      16.9      17
  6  2012             Colorado      19.2    13.7
  7  2012          Connecticut      17.5    10.7
  8  2012             Delaware      18.6      12
  9  2012 District of Columbia      23.1    18.2
  10 2012              Florida      16.5    17.1
  </code></pre>