now that's beautiful! :-) Many thanks, David.
> Try this where DF1, DF2 and DF3 are the data frames: > > L <- list(DF1, DF2, DF3) > merge.all <- function(...) merge(..., all = TRUE) > Reduce(merge.all, lapply(L, function(x) aggregate(x[2], x[1], toString))) > > The last line gives this: > > Src Target1 Target2 Target3 > 1 1 aaa, bbb, ccc <NA> xx > 2 2 aaa aaaa <NA> > 3 3 ddd dddd yy > 4 4 <NA> bbbb, eeee, ffff <NA> > 5 5 <NA> <NA> zz > 6 6 <NA> <NA> tt, uu ______________________________________________ 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.