尝试在具有400个样本的数据集上运行Random Forest,并在数据帧df中运行大约360个变量:
我正在尝试使用变量( s10
, s100
等等)来预测基因型 . 这是我正在使用的代码:
rf <-randomForest(Genotype ~ ., data = df, importance = TRUE, proximity = TRUE)
但我一直收到错误信息:
Error in if (n == 0) stop("data (x) has 0 rows") :
argument is of length zero
我究竟做错了什么?
1 回答
首先,不要将对象命名为R函数(即,“df”) . 其次,尝试randomForest的非公式接口 . 让我们来到你的位置 .