merge can only merge two objects at a time- I would like to merge more than two objects at a time.
s.d <- structure(list(RiverMile = c(202L, 198L, 190L, 185L, 179L, 148L, 119L, 61L)), .Names = "RiverMile", row.names = c(NA, -8L), class = "data.frame") #s.d is all of the river miles that can occur in all of the data frames that I want to put together feb06 <- structure(list(RiverMile = c(202L, 190L, 185L), X2.1.06 = c(2850000, NA, NA)), .Names = c("RiverMile", "X2.1.06"), row.names = c(29L, 31L, 32L), class = "data.frame") may06 <- structure(list(RiverMile = c(202L, 198L, 190L, 185L, 148L), X5.1.06 = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_)), .Names = c("RiverMile", "X5.1.06"), row.names = c(29L, 30L, 31L, 32L, 34L), class = "data.frame") jun06 <- structure(list(RiverMile = c(202L, 198L, 190L, 185L, 148L), X6.1.06 = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_)), .Names = c("RiverMile", "X6.1.06"), row.names = c(29L, 30L, 31L, 32L, 34L), class = "data.frame") merge(s.d, feb06, all=T) RiverMile X2.1.06 1 61 NA 2 119 NA 3 148 NA 4 179 NA 5 185 NA 6 190 NA 7 198 NA 8 202 2850000 #this is what I want- is there a way to implement this over many data frames -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.