I got an error when exporting data from R
问题 When I wanted to export my results from R with this code, write.table(imp, "c:/immp.txt", sep="\t") I got this error: Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class ""mids"" to a data.frame Sorry for a simple question,I am new to R. Thanks for your help 回答1: It looks like you're trying to export a "mids" object, as opposed to a data frame. You'll need to convert it to a data frame before using write.table, which you should be