title: Removing days before and after matching row
body: <p>I am able to remove rows that match between two data frames, df1 and df2, with some code kindly furnished by @Eric Fail:</p>
  
  <p><code>df1[!(apply(df1[1:2], 1, toString) %in% apply(df2[1:2], 1, toString)), ]</code> </p>
  
  <p>or with a <code>dplyr</code> solution by @steveb</p>
  
  <p><code>df1 %&gt;% filter( ! ((date == df2$date) &amp; (ticker == df2$ticker)) )</code></p>
  
  <p>However, I realized I need to remove not only the shared row like this: </p>
  
  <pre><code>df1 &lt;- data.frame(ticker = c("MSFT", "MSFT", "MSFT", "MSFT"), 
  date = c("2016-01-01", "2016-01-02", "2016-01-03", "2016-01-04"), stringsAsFactors=F)
  df1
  
    ticker       date
  1   MSFT 2016-01-01
  2   MSFT 2016-01-02
  3   MSFT 2016-01-03
  4   MSFT 2016-01-04
  
  df2 &lt;- data.frame(ticker = c("AAPL", "GOOG", "MSFT", "FB"), 
  date = c("2016-01-01", "2016-01-01", "2016-01-02", "2016-01-03"), stringsAsFactors=F)
  df2
  
    ticker       date
  1   AAPL 2016-01-01
  2   GOOG 2016-01-01
  3   MSFT 2016-01-02
  4     FB 2016-01-03
  
  df3 
  
    ticker       date
  1   MSFT 2016-01-01
  2   MSFT 2016-01-03
  3   MSFT 2016-01-04
  </code></pre>
  
  <p>But also the day before, and the day after, the specified row. So my final df would be:</p>
  
  <pre><code>  ticker       date
  1   MSFT 2016-01-04
  </code></pre>
  
  <p>Notice, <code>3   MSFT 2016-01-02</code> was the match, so that row needs to be removed, along with the day before and day after, <code>3   MSFT 2016-01-01</code> and <code>3   MSFT 2016-01-03</code></p>
  
  <p>Example with two matches:</p>
  
  <pre><code>df1 &lt;- data.frame(ticker = c("MSFT", "MSFT", "MSFT", "MSFT"),
                    date = as.Date(c("2016-01-01", "2016-01-02", "2016-01-03", "2016-01-04")),
                    stringsAsFactors=F)
  df2 &lt;- data.frame(ticker = c("AAPL", "GOOG", "MSFT", "MSFT"),
                    date = as.Date(c("2016-01-01", "2016-01-01", "2016-01-01","2016-01-02")),
                    stringsAsFactors=F)
  </code></pre>
  
  <p>Goal output: </p>
  
  <pre><code>ticker       date
  4   MSFT 2016-01-04
  </code></pre>