title: R: delete rows that have two columns with the same first digit
body: <p>I want to delete rows whose county fips codes start with the same number.</p>
  <pre><code># What I have ----
  
  x.dist = data.frame(county1=c(8001,8001,8001),
                      mi_to=c(10:12),
                      county2=c(8005,34502,8007))
  &gt; x.dist
    county1 mi_to county2
  1    8001    10    8005
  2    8001    11   34502
  3    8001    12    8007
  
  # What I want ----
  
    county1 mi_to county2
  2    8001    11   34502
  </code></pre>
  <p>In the original df, county1 and county2 both start with 8 in rows 1 and 3. I want the first digit in each column to differ so I'm left with row 2. How do I do this?</p>
  <p>I tried this, but absolutely nothing happened.</p>
  <pre><code>w.dist = x.dist %&gt;%   
  filter(str_sub(county1, start= 1) != (str_sub(county2, start= 1)))
  </code></pre>