I have a data1 with 95 columns Zero rows(empty data frame) and data2 with 53 columns 50 rows. Both data frames have same column names. I want 95 columns present in data1 with updated data2 column values remaining column values will be zero.
I have tried like below:
data1 <-ifelse(colnames(data2)%in%colnames(data1),data2,data1)
The output I am getting data2 with 53 columns. But, I want output as described above.
Please, help me through it.