Converting ctree output into JSON Format (for D3 tree layout)
问题 I'm working on a project that requires to run a ctree and then plot it in interactive mode - like the 'D3.js' tree layout, my main obstacle is to convert the ctree output into a json format, to later use by javascript. Following is what i need (with example from the iris data): > library(party) > irisct <- ctree(Species ~ .,data = iris) > irisct Conditional inference tree with 4 terminal nodes Response: Species Inputs: Sepal.Length, Sepal.Width, Petal.Length, Petal.Width Number of