当我想使用此代码从R导出结果时,
write.table(imp, "c:/immp.txt", sep="\t")
我收到了这个错误:
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class ""mids"" to a data.frame
抱歉一个简单的问题,我是R.的新手 谢谢你的帮助
答案 0 :(得分:1)
看起来您正在尝试导出“mids”对象,而不是数据框。在使用write.table之前,您需要将其转换为数据框,您应该可以使用complete():
no_token()
根据需要调整数据选项。然后尝试使用write.table命令。