Skip to content
Prev 171009 / 398503 Next

Multiple merge, better solution?

Hi: Below is a TOTAL HACK and I don't recommend it but it does seem to 
do what you want. I think that I remember Gabor saying that you can 
merge multiple data frames using zoo but I don't know the specifics. I'm 
sure he'll respond with the correct way. Below uses a global variable 
to access the
dataframe inside the loop and keeps adding on to it. Don't use it unless 
you're really desperate for a solution.

DF <- DF1

for ( .df in list(DF2,DF3,DF4) ) {
   DF<<-merge(DF,.df,by.x="var1", by.y="var1", all=T)
}

print(DF)
On Thu, Feb 19, 2009 at 5:21 AM, Lauri Nikkinen wrote: