Selecting rows with partial match/mismatch in 2 columns
<p>I am looking how to select rows in R which have partial matches or mismatches in two columns. My dataset (as an example) looks like this:</p>

<pre><code>df = data.frame(plot1 = c("ABX_15", "BHE_05", "ABX_15"), 
                plot2 = c("AB6_15", "JKS_05", "JKS_05"),
                value = c(0.4, 0.45, 0.34))
</code></pre>

<p>I want to create subsets containing only "matched" pairs of <code>plot1</code> and <code>plot2</code> for <code>_05</code> and <code>_15</code>. So that would be either the first row or the second row in the example. I also need to select only rows which have a missmatch in <code>plot1</code> and <code>plot2</code>, that would be row number three. Match an missmatch refer only to the second part of the plot name.</p>

<p>I've found solutions for partial selecting and for selecting certain rows according to columns but I could not combine both.</p>

<p>I am expecting 3 subsets of the dataset: One with matching <code>_05</code> another with matching <code>_15</code> and one with missmatches.</p>