Some example data of stucture:
df1 = data.frame(x=c('a', 'b', 'c', 'd', 'e'))
df2 = data.frame(x=c('f', 'g', 'h'),y = c(0,1,0))
df3 = data.frame(x=c('i', 'j','k','l'), y = c(1,7,5,2,6), z = c(75,3,25,2,1))
I have 3 different dataframes.
df1 has 22201 object and 121 variables df2 has 8403 object and 68 variables df3 has 50476 object and 157 variables
I try to merge them using merge and I receive this error:
Error in fix.by(by.x, x) :
'by' must specify one or more columns as numbers, names or logical
using cbind and I received this error:
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 22201, 8403, 50476
and rbind and I receive this error:
Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match
How can I merge dataframes with different number of rows and columns? I have to refer that columns have the same names in dataframes so in the merge I expect the number of columns be the highest numbers of columns of the dataframe which contains the most.