<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/r%e2%81%b6-disproving-approval/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://rud.is/b/2017/06/18/r%E2%81%B6-disproving-approval/"> R – rud.is</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>I couldn’t let this stand unchallenged:</p>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">The new Rasmussen Poll, one of the most accurate in the 2016 Election, just out with a Trump 50% Approval Rating.That's higher than O's #'s!</p>
<p>— Donald J. Trump (<a rel="nofollow" href="http://twitter.com/realDonaldTrump" target="_blank">@realDonaldTrump</a>) <a rel="nofollow" href="https://twitter.com/realDonaldTrump/status/876394578777174021" target="_blank">June 18, 2017</a></p></blockquote>
<p></p>
<p>Ramussen makes their Presidential polling data <a rel="nofollow" href="http://m.rasmussenreports.com/public_content/politics/trump_administration/trump_approval_index_history" target="_blank">available</a> for both <img alt="🍊" src="https://s.w.org/images/core/emoji/2/72x72/1f34a.png" class="wp-smiley"> &amp; O. Why not compare their ratings from day 1 in office (skipping days that Ramussen doesn’t poll)?</p>
<p><a rel="nofollow" href="https://i1.wp.com/rud.is/b/wp-content/uploads/2017/06/Plot_Zoom.png?ssl=1" target="_blank"><img alt="" src="https://i1.wp.com/rud.is/b/wp-content/uploads/2017/06/Plot_Zoom.png?resize=780%2C390&ssl=1" class="wp-image-6097" data-recalc-dims="1"></a></p>
<pre><code>library(hrbrthemes)
library(rvest)
library(tidyverse)

list(
  Obama=&quot;http://m.rasmussenreports.com/public_content/politics/obama_administration/obama_approval_index_history&quot;,
  Trump=&quot;http://m.rasmussenreports.com/public_content/politics/trump_administration/trump_approval_index_history&quot;
) %>% 
  map_df(~{
    read_html(.x) %>%
      html_table() %>%
      .[[1]] %>%
      tbl_df() %>%
      select(date=Date, approve=`Total Approve`, disapprove=`Total Disapprove`)
  }, .id=&quot;who&quot;) -> ratings

mutate_at(ratings, c(&quot;approve&quot;, &quot;disapprove&quot;), function(x) as.numeric(gsub(&quot;%&quot;, &quot;&quot;, x, fixed=TRUE))/100) %>%
  mutate(date = lubridate::dmy(date)) %>%
  filter(!is.na(approve)) %>%
  group_by(who) %>%
  arrange(date) %>%
  mutate(dnum = 1:n()) %>%
  ungroup() %>%
  ggplot(aes(dnum, approve, color=who)) +
  geom_hline(yintercept = 0.5, size=0.5) +
  geom_point(size=0.25) +
  scale_y_percent(limits=c(0,1)) +
  scale_color_manual(name=NULL, values=c(&quot;Obama&quot;=&quot;#313695&quot;, &quot;Trump&quot;=&quot;#a50026&quot;)) +
  labs(x=&quot;Day in office&quot;, y=&quot;Approval Rating&quot;,
       title=&quot;Presidential approval ratings from day 1 in office&quot;,
       subtitle=&quot;For fairness, data was taken solely from Trump's favorite polling site (Ramussen)&quot;,
       caption=&quot;Data Source: &lt;rasmussenreports.com>\nCode: </code></pre>