R function merge() can be used to merge two data frames by common column or row names. You can find the details about this function here. Using the "by" argument, you can specify the common column name.
Here is an example to show how to use this function:
df1 <- data.frame(Name=c('A', 'B', 'C', 'D', 'E', 'F'), DOB=c(2020,2017,2012,1980,1998,1967))df2 <- data.frame(Name=c('A', 'B', 'C', 'D', 'E', 'F'), Income=c(12020,22017,22012,31980,11998,21967))df <- merge(df1, df2, by.x = "Name")
df1 <- data.frame(Name=c('A', 'B', 'C', 'D', 'E', 'F'), DOB=c(2020,2017,2012,1980,1998,1967))
df2 <- data.frame(Name=c('A', 'B', 'C', 'D', 'E', 'F'), Income=c(12020,22017,22012,31980,11998,21967))
df <- merge(df1, df2, by.x = "Name")
The output of the above code:
> df Name DOB Income1 A 2020 120202 B 2017 220173 C 2012 220124 D 1980 319805 E 1998 119986 F 1967 21967