You can combine dataframes with the merge function. Since you have several data frames, you can use Reduce to combine them all at once.
merged.data <- Reduce(function(...) merge(...), list(dfSub[[1]], dfSub[[2]], dfSub[[3]], dfSub[[4]])
As an example:
> people <- c('Bob', 'Jane', 'Pat') > height <- c(72, 64, 68) > weight <- c(220, 130, 150) > age <- c(45, 32, 35) > height.data <- data.frame(people, height) > weight.data <- data.frame(people, weight) > age.data <- data.frame(people, age) > height.data people height 1 Bob 72 2 Jane 64 3 Pat 68 > weight.data people weight 1 Bob 220 2 Jane 130 3 Pat 150 > age.data people age 1 Bob 45 2 Jane 32 3 Pat 35 > Reduce(function(...) merge(...), list(height.data, weight.data, age.data)) people height weight age 1 Bob 72 220 45 2 Jane 64 130 32 3 Pat 68 150 35
source share