我正在使用插入符号在数据集上运行交叉验证的随机森林。Y变量是一个因素。我的数据集中没有NaN,Inf或NA。但是,当运行随机森林时,我得到
Error in randomForest.default(m, y, ...) :
NA/NaN/Inf in foreign function call (arg 1)
In addition: There were 28 warnings (use warnings() to see them)
Warning messages:
1: In data.matrix(x) : NAs introduced by coercion
2: In data.matrix(x) : NAs introduced by coercion
3: In data.matrix(x) : NAs introduced by coercion
4: In data.matrix(x) : NAs introduced by coercion
有没有人知道此错误是否是由强制引入的NA引起的?如果是这样,我如何防止这种胁迫?