Re: [R] merging dataframes with diffent rownumbers

From: Petr Klasterecky <klaster_at_karlin.mff.cuni.cz>
Date: Mon, 18 Jun 2007 12:58:13 +0200

No easy to understand what exactly you mean, but try

?merge
?cbind
?rbind

Petr

Thomas Hoffmann napsal(a):
> Dear R-Helpers,
>
> I have following problem:
>
> I do have two data frames dat1 and dat2 with a commen column BNUM (long
> integer). dat1 has a larger number of BNUM than dat2 and different rows
> of dat2 have equal BNUM. The numbers of rows in dat1 and dat2 is not
> equal. I applied the tapply-function to dat2 with BNUM as index. I
> would like to add the columns from dat1 to the results of
>
> b.sum <- tapply(dat2, BNUM, sum).
>
> However the BNUM of b.sum are only a subset of the dat1.
>
> Does anybody knows a elegant way to solve the problem?
> Thanks in advance
>
> Thomas H.
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch 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.
>

-- 
Petr Klasterecky
Dept. of Probability and Statistics
Charles University in Prague
Czech Republic

______________________________________________
R-help_at_stat.math.ethz.ch 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.
Received on Mon 18 Jun 2007 - 11:03:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 18 Jun 2007 - 11:32:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.