Converts the tree in an SDTree object from class Node Glur2023Data.tree:StructureSDModels to class list. This makes it substantially easier to save the tree to disk.

# S3 method for class 'SDTree'
toList(object, ...)

Arguments

object

an SDTree object with the tree in Node format

...

Further arguments passed to or from other methods.

Value

an SDTree object with the tree in list format

References

See also

Author

Markus Ulmer

Examples

set.seed(1)
n <- 10
X <- matrix(rnorm(n * 5), nrow = n)
y <- sign(X[, 1]) * 3 + rnorm(n)
model <- SDTree(x = X, y = y, Q_type = 'no_deconfounding', cp = 0.5)
toList(model)
#> Tree in list format use fromList()!