Skip to content
Prev 315073 / 398506 Next

Merging list of dataframes with reshape merge_all

Hello,

To "solve" the problem you can use all.x and all.y but I think there are 
other problems with merge_all, in the example below it doesn't include 
df2$Y in the result df.


df1 <- data.frame(col1=1:10, col2=11:20, col3=21:30, X = rnorm(10))
df2 <- data.frame(col1=1:10, col2=11:20, col3=21:30, Y = rnorm(10))

merge_all(list(df1, df2), by=c("col1","col2","col3"), all.x=TRUE, 
all.y=TRUE)  # No Y column
merge(df1, df2, by=c("col1","col2","col3"), all.x=TRUE, all.y=TRUE)


Contact the package maintainer for more info.

maintainer('reshape')
[1] "Hadley Wickham <h.wickham at gmail.com>"


Hope this helps,

Rui Barradas

Em 11-01-2013 10:08, Johannes Radinger escreveu: