[R] merge
Gabor Grothendieck
ggrothendieck at gmail.com
Fri Apr 16 14:26:52 CEST 2010
Try this:
library(plyr)
rbind.fill(DF1, DF2)
On Fri, Apr 16, 2010 at 8:00 AM, n.vialma at libero.it <n.vialma at libero.it> wrote:
> I have a problem with the merge command.
> I have to merge two dataframe that looks like the following example:
>
> CODPROD N1 N3 N4
> 23 3 55 4
> 24 5 67 36
> 25 3 73 24
>
>
>
> second data frame
>
>
> CODPROD N1 N2
> 30 34 45
> 45 0 78
> 65 0 56
>
>
> The result should be:
>
> CODPROD N1 N2 N3 N4
> 23 3 NA 55 4
> 24 5 NA 67 36
> 25 3 NA 73 24
> 30 34 45 NA NA
> 45 0 78 NA NA
> 65 0 56 NA NA
>
> Anyone knows how to do it??
>
> ______________________________________________
> R-help at 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.
>
More information about the R-help
mailing list