Error in bind_rows_(x, .id) : Column can't be converted from factor to numeric
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))