我正在尝试"降级"使用for循环的一组列。
for(j in 8:ncol(trainVote)){
trainVote$colnames(trainVote[j]) <- relevel(as.factor(trainVote$colnames(trainVote[j])),
which.max(table(trainVote$colnames(trainVote[j]))))
}
错误:is.factor(x)出错:尝试应用非功能
我做错了什么帮助?