title: Select only rows where the last date is present
body: <p>Let's say that I have the following data.</p>
  
  <pre><code>df = data.frame(name = c("A","A","A","B","B","B","B"),
                  date = c("2011-01-01","2011-03-01","2011-05-01",
                           "2011-01-01","2011-05-01","2011-06-01",
                           "2011-07-01"))
  df
  </code></pre>
  
  <p>I know the last date in the data set and only want to pick those names where data is available for the last date. So in the above example, the last date is only available for name B. Thus, I want to select only the rows for name B.</p>
  
  <p>I can do simple hacks like this to get the desired result.</p>
  
  <pre><code>last_date = "2011-07-01"
  
  #unique(df$name[df$date %in% last_date])
  df[df$name %in% unique(df$name[df$date %in% last_date]),]
  </code></pre>
  
  <p>However, I was wondering if there was a dplyr/tidyverse or data.table solution for this task. </p>