我的问题是关系到这一个 关于分类数据使用插入符包时(在R项因素).我从链接的帖子中了解到,如果你使用"公式界面",一些功能可能是因素,培训将正常工作.我的问题是如何使用该preProcess()功能扩展数据?如果我尝试在具有某些列作为因素的数据框上执行此操作,则会收到以下错误消息:
Error in preProcess.default(etitanic, method = c("center", "scale")) :
all columns of x must be numeric
Run Code Online (Sandbox Code Playgroud)
在这里看到一些示例代码:
library(earth)
data(etitanic)
a <- preProcess(etitanic, method=c("center", "scale"))
b <- predict(etitanic, a)
Run Code Online (Sandbox Code Playgroud)
谢谢.