title: R ctree strange error
body: <p>I have some strange problem in for loops with ctree data. If I write this code in a loop then R freezes.</p>
  
  <pre><code>data = read.csv("train.csv") #data description https://www.kaggle.com/c/titanic-gettingStarted/data
  
  treet = ctree(Survived ~ ., data = data)
  print(plot(treet))
  </code></pre>
  
  <p>Sometimes I get an error: "More than 52 levels in a predicting factor, truncated for printout" and my tree is showing in very weird way. Sometimes works just fine. Really, really strange! </p>
  
  <p>My Loop code:</p>
  
  <pre><code>functionPlot &lt;- function(traine, i) {
    print(i) # print only once, then RStudio freezes
    tempd &lt;- ctree(Survived ~ ., data = traine)
    print(plot(tempd))
  }
  
  for(i in 1:2) {
    smp_size &lt;- floor(0.70 * nrow(data))
    train_ind &lt;- sample(seq_len(nrow(data)), size = smp_size)
    set.seed(100 + i)
    train &lt;- data[train_ind, ]
    test &lt;- data[-train_ind, ]
  #
    functionPlot(train,i)
  }
  </code></pre>