title: Running `ctree` using `party` package, column as factor and not character
body: <p>I have referred <a href="https://stackoverflow.com/questions/9251326/convert-data-frame-column-format-from-character-to-factor">convert data.frame column format from character to factor</a> and <a href="https://stackoverflow.com/questions/18525976/converting-multiple-data-table-columns-to-factors-in-r">Converting multiple data.table columns to factors in R</a> and <a href="https://stackoverflow.com/questions/7813578/convert-column-classes-in-data-table">Convert column classes in data.table</a></p>
  
  <p>Unfortunately it did not solve my problem. I am working with the bodyfat dataset and my dataframe is called > bf. I added a column called agegrp to categorize persons of different ages as young, middle or old thus : </p>
  
  <pre><code>bf$agegrp&lt;-ifelse(bf$age&lt;=40, "young", ifelse(bf$age&gt;40 &amp; bf$age&lt;55,"middle", "old"))
  </code></pre>
  
  <p>This is the ctree analysis:</p>
  
  <pre><code>&gt; set.seed(1234)
  &gt; modelsample&lt;-sample(2, nrow(bf), replace=TRUE, prob=c(0.7, 0.3))
  &gt; traindata&lt;-bf[modelsample==1, ]
  &gt; testdata&lt;-bf[modelsample==2, ]
  &gt; predictor&lt;-agegrp~DEXfat+waistcirc+hipcirc+kneebreadth` and ran, `bf_ctree&lt;-ctree(predictor, data=traindata)
  &gt; bf_ctree&lt;-ctree(predictor, data=traindata)
  </code></pre>
  
  <p>I got the following error: </p>
  
  <pre><code>Error in trafo(data = data, numeric_trafo = numeric_trafo, factor_trafo = factor_trafo,  : 
    data class character is not supported
  In addition: Warning message:
  In storage.mode(RET@predict_trafo) &lt;- "double" : NAs introduced by coercion
  </code></pre>
  
  <p>Since <code>bf$agegrp</code> is of class "character" I ran, </p>
  
  <pre><code>&gt; bf$agegrp&lt;-as.factor(bf$agegrp)
  </code></pre>
  
  <p>the agegrp column is now coerced to factor. </p>
  
  <p><code>&gt; Class (bf$agegrp)</code> gives <code>[1] "Factor"</code>.</p>
  
  <p>I tried running the <code>ctree</code> again, but it throws the same error. Does anyone know what the root-cause of the problem is?</p>