'Undefined Columns Selected for R Classification Tree
I am working with the popular tumor dataset in R, trying to create a classification tree that predicts the classification of the Diagnosis variable. However, when I run my tree() statement on my training dataset (which contains only numeric variables), I get the following error:
tumor.tree <- tree(Diagnosis ~ ., data = tumor.train)
Error in `[.data.frame`(frame, predictors) : undefined columns selected
I have seen that this sometimes happens when column names are numbers, but none of my column names are numbers in this example. I am not sure what could be the issue in my call to tree(), and would appreciate any advice. Thank you!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
