Back

Explore Courses Blog Tutorials Interview Questions
+3 votes
4 views
in R Programming by (3.4k points)
I want to bind two data frames with different set of columns and  I also want to retain all the columns that fails to match after the bind, How can I do that in R?

1 Answer

0 votes
by (46k points)
edited by

Install plyr package if you don't have it, and then use rbind.fill :

df4 <- rbind(df2, df3[, names(df2)])

If columns in df1 is a subset of those in df2 (by the names of column

For any help regarding installation of plyr package click here.

Cheers....!!

Related questions

+3 votes
1 answer
asked May 29, 2019 in R Programming by Anvi (10.2k points)
+1 vote
1 answer
asked May 29, 2019 in R Programming by Krishna (2.6k points)
+1 vote
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...