R: Replace NAs in Predictor Variables

na.tree.replace {tree} | R Documentation

## Replace NAs in Predictor Variables

### Description

Adds a new level called `"NA"` to any discrete predictor in a data frame that contains `NA`s. 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 `NA`s.

### See Also

`tree`, `na.omit`.

[Package tree version 1.0-39 Index]