这是我的数据集GF的前几行:
GDI LEBF EEF EGIF LFRF MYSF Level
0.996 83.6 18.2 57140 61.2 12.6 Developed
0.976 84.5 20.7 33688 58.8 12.9 Developed
0.950 85.0 15.7 44132 61.8 13.9 Developed
我正在尝试为变量Level创建分类树,如下所示:
require(tree)
GF <- dataset[,c("GDI", "LEBF", "EEF", "EGIF", "LFRF", "MYSF", "Level")]
tree_f <- tree(formula = Level ~., data = GF)
plot(tree_f)
text(tree_f)
但是,我得到的错误是强制性引入了NA,我不知道是怎么回事。