title: R package for binary trees
body: <p>I am trying to manually fit oblique regression trees for a project. Compared to the regression trees found in R packages like <code>tree</code>, this project minimizes a completely different function to find the separating hyperplane at each node. So the usual regression tree packages like <code>tree</code> don't cut it.</p>
  <p>As such, I am looking for a more generic binary tree package in R that allows you to store other data structures at each node. More specifically, I want to store a vector representing the separating hyperplane at each node.</p>
  <p>What I have tried so far: I came across the <code>data.tree</code> package in R. It is indeed a more generic binary tree package. However, it doesn't allow me to store anything other than a string at each node. For instance, I get this issue when I try to store a vector at the root node:</p>
  <pre><code>library(data.tree)
  
  v = c(1,2)
  
  Node$new(v)
  # Error in dimnames(res) &lt;- `*vtmp*` : 
  #   length of 'dimnames' [2] not equal to array extent
  # In addition: Warning message:
  # In if (name %in% NODE_RESERVED_NAMES_CONST) { :
  #   the condition has length &gt; 1 and only the first element will be used
  </code></pre>
  <p>And if I try to specify the name of the root node before putting in the vector, the name of the root does set but the vector does not get stored:</p>
  <pre><code>Node$new(&quot;zero&quot;, v)
  #   levelName
  # 1      zero
  </code></pre>
  <p>Thus, I am wondering if a better R binary tree package is out there that allows you to store other data structures in the nodes, more akin to the generic binary trees of lower level languages.</p>