I have a decision tree represented as a list in R:
tree = list(
"Bin type" = list(
"no bin" = list(
"SOA linearity" = list(
"linear" = list("Linear MEM")
, "non-linear" = list("GAMM")
)
)
, "bin" = list(
"SOA type" = list(
"SOA as categorical" = list(
"Tool" = list(
"ANOVA"
, "MEM"
)
)
, "SOA as continuous" = list(
"SOA linearity" = list(
"linear" = list(
"Tool" = list(
"ANOVA"
, "MEM"
)
)
, "non-linear" = list("GAMM")
)
)
)
)
)
)
Is there a quick way to visualize this as a tree diagram?
I don't think there's an immediate way, since packages for plotting trees would want a specific data structure for the tree which would unlikely match your list. So likely you'll need to convert your list into another form.
I would look at the igraph package. I'd start with the graph()
function; if you could convert your list (describing a tree) to a graph, the igraph
package would help you to plot it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With