I'll explain my problem using an example with the iris table. Let's say I want to create a tree between sepal width and species. For this I will use this code:
ctree(Species~Sepal.Width,data=iris)->a
plot(a,type="simple")
The problem is that, if I want to do a data frame, for example counting the quantity of cases in each node (from 0 to 2.9; 2.9 to 3.3, etc), the only way I've found to do this is by creating a new vector manually and then using the dcast
or table
function.
The problem with this solution is that if I had a bigger tree result, it could be quite difficult. Do you know any other solution for this? Thanks a lot.