Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

na.tree.replace

Replace NAs in Predictor Variables


Description

Adds a new level called "NA" to any discrete predictor in a data frame that contains NAs. Stops if any continuous predictor contains an NA.

Usage

na.tree.replace(frame)

Arguments

frame

data frame used to grow a tree.

Details

This function is used via the na.action argument to tree.

Value

data frame such that a new level named "NA" is added to any discrete predictor in frame with NAs.

See Also


tree

Classification and Regression Trees

v1.0-40
GPL-2 | GPL-3
Authors
Brian Ripley [aut, cre]
Initial release
2019-03-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.