title: Ctree R function is not working with my for loop
body: <p>I wanted to make a list for <code>for</code> loop, than I wanted to use it for <code>ctree</code> like below. but I couldn't.
  I am getting, some errors like &quot;<strong>character is not supported</strong>&quot; even I change the list to <code>factor</code></p>
  <p>I want to change <code>val</code> variable, with the <code>y</code> list, for <code>for</code> loop.</p>
  <p>Is there anyway to make it work?</p>
  <pre><code>y &lt;- c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;)
  x &lt;- as.factor(y)
  for(val in x) {
        ctree_model&lt;- ctree(FTR ~ val, data = train,controls=ctree_control(minsplit=30,minbucket=10,maxdepth=10))
      }
  </code></pre>