title: Delete rows based on a match between two different columns in a data frame
body: <p>I have a data frame with daily channel revenue from multiple channels. The data frame looks like the following:</p>
  <pre><code>orders_dataframe:
  
      Order |Channel | Revenue |
      1     |TV      | 120     |
      2     |Email   | 30      |
      3     |Retail  | 300     |
      4     |Shop1   | 50      |
      5     |Shop2   | 90      |
      6     |Email   | 20      |
      7     |Retail  | 250     |
  </code></pre>
  <p>What I would like to do is to split those revenues coming from Retail and divide them between Shop1 and Shop2 according to a predefined ratio (e.g., 60%/40% split). For example, I would like that all rows with revenue coming from &quot;Retail&quot; get attributed 60% to Shop1 and 40% to Shop2. This can be reflected by replacing all retail-revenue rows with two new rows, as seen for Order 3 and Order 7 in the final table I want to get below:</p>
  <pre><code>orders_dataframe:  
  
      Order |Channel | Revenue |
      1     |TV      | 120     |
      2     |Email   | 30      |
      3     |Shop1   | 180     |
      3     |Shop2   | 120     |
      4     |Shop1   | 50      |
      5     |Shop2   | 90      |
      6     |Email   | 20      |
      7     |Shop1   | 150     |
      7     |Shop2   | 100     |
  </code></pre>
  <p>Ideally, since I am performing this with various datasets, I would like to take the percentages from a data frame (split_dataframe) instead of manually assigning the figures 60% and 40%. I would like to use the figures from a dataset like below:</p>
  <pre><code>split_dataframe:
      Channel |Percent  |
      Shop1   |60%      | 
      Shop2   |40%      | 
  </code></pre>
  <p>Here is a reproducible example of the two data frames:</p>
  <pre><code>orders_dataframe &lt;- data.frame(Order = c(1,2,3,4,5,6,7),
                                Channel = c(&quot;TV&quot;, &quot;Email&quot;, &quot;Retail&quot;, &quot;Shop1&quot;, &quot;Shop2&quot;, &quot;Email&quot;, &quot;Retail&quot;), 
                                Revenue = c(120,30,300,50,90,20,250))
  
  split_dataframe &lt;- data.frame(Channel = c(&quot;Shop1&quot;, &quot;Shop2&quot;),
                                Percent = c(0.6, 0.4))
  </code></pre>
  <p>Thank you very much!</p>