title: Conditional partitioning
body: <p>I would like to partition a variable V2 using a variable V1. And V1 depends on a third variable V3.</p>
  
  <p>In the following R code the variable V1 depends on a variable V3 such as when V3 equals 10 and V2 is 1, V1 equals 1.</p>
  
  <p><strong>Is there an algorithm which is able to do this ?</strong></p>
  
  <pre><code>library(partykit)
  set.seed(100)
  V1&lt;-sample(100);V2&lt;-ifelse(V1&gt;50,1,0);V3&lt;-sample(1:10,100,replace=T);
  V1[V3==10&amp;V2==1]&lt;-5
  
  ctree(V2~V1+V3)
  #ctree output :
  
        V1&lt;=50
        ___|___  
        |     |
      V1&lt;=5   1
     __|___
     |     |
   V3&lt;=6   0
   ___|___  
   |      | 
  0.88  0.98
  
  my_algorithm(V2~V1|V3) 
  #Expected output (optimal tree) :
  
   V1&gt;50
     |
  _______
  |     |
  1     V3&lt;10
          |
       _______
       |     |
       0     1
  </code></pre>
  
  <p>For instance ctree is not giving an optimal classification (see above). </p>
  
  <p>My question is probably unclear so feel free to edit it. Thank you.</p>