Error in bind_rows_(x, .id) : Column can't be converted from factor to numeric

馋奶兔 提交于 2019-11-29 07:33:34

I think that this should work:

library(plyr)
all_data <- rbind.fill(data1,data2)

As the file are usually small (several hundred rows) and you simply want to combine the two file and write to a new file, I think we can convert all columns to character, thus the common columns in data1 and data2 will have the same type.

library(dplyr)
bind_rows(mutate_all(data1, as.character), mutate_all(data2, as.character))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!