summary: Summarise a Fitted dpart Object

View source: R/summary.dpart.R

summaryR Documentation

Summarise a Fitted dpart Object

Description

Outputs a detailed listing of the classification tree to file: tree_output.txt

Usage

summary(object, ...)

## S3 method for class 'dpart'
summary(object, cp = 0, digits = getOption("digits"),
  file = "tree_output.txt", ...)

## S3 method for class 'rpart'
summary(object, cp = 0, digits = getOption("digits"),
  file, ...)

Arguments

object

dpart object

...

additional arguments affecting the summary produced

cp

trim nodes with a complexity of less than cp from the listing.

digits

Number of significant digits to be used in the result.

file

write the output to a given file name. (Full listings of a tree are often quite long). Default file name is tree_output.txt.

Details

This function is a method for the generic function summary for class dpart. It can be invoked by calling summary for an object of the appropriate class, or directly by calling summary.dpart regardless of the class of the object. By default the summary is written to file.

See Also

summary, dpart, print.dpart

Examples


# Assigning prey colours for default palette
val <- apc(x = yftdiet, preyfile = PreyTaxonSort, check = TRUE)
node.colsY <- val$cols
dietPP <- val$x   # updated diet matrix with Group assigned prey taxa codes

# Fitting the classification tree
yft.dp <- dpart(Group ~ Lat + Lon + Year + Quarter + SST  + Length, 
                  data = dietPP, weights = W, minsplit = 10,
                                    cp = 0.001)
                                    
plot(yft.dp, node.cols = node.colsY)
summary(yft.dp)
#print(yft.dp, setID = "TripSetNo")

pkuhnert/diet documentation built on June 10, 2025, 2:59 a.m.