copy.SDTree: Copy a tree

View source: R/copy.R

copy.SDTreeR Documentation

Copy a tree

Description

Returns a copy of the tree object. Might be useful if you want to keep the original tree in comparison to the pruned tree.

Usage

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

Arguments

object

an SDTree object

...

Further arguments passed to or from other methods.

Value

A copy of the SDTree object

Author(s)

Markus Ulmer

See Also

prune

Examples


set.seed(1)
X <- matrix(rnorm(10 * 20), nrow = 10)
Y <- rnorm(10)
fit <- SDTree(x = X, y = Y, cp = 0.5)
fit2 <- copy(fit)

SDModels documentation built on April 11, 2025, 5:50 p.m.