Jérôme Lemaître
2005-Sep-27 19:27 UTC
[R] Binding dataframe with different length in rows and columns
Dear all, I'm trying to combine in R the two following datasets. I'm would be very grateful if someone could help me with this problem. Dataset 1: X Y Z 1 27 48 2 25 50 3 27 40 4 28 56 Where X is a unique number and Y and Z some variables Dataset 2: X I J 1 10 12 1 12 12 1 23 30 1 40 46 2 7 8 2 8 9 2 9 8 3 2 0 4 98 87 4 78 89 Where X IS NOT this time a unique number. I and J are some variables. Thank you by advance J??r??me Lema??tre ??tudiant au doctorat Universit?? Laval Qu??bec, QC
Nolwenn LeMeur
2005-Sep-27 19:45 UTC
[R] Binding dataframe with different length in rows and columns
Hi Jerome, look at the merge() function Nolwenn On Tue, 27 Sep 2005, J?r?me Lema?tre wrote:> Dear all, > > I'm trying to combine in R the two following datasets. > I'm would be very grateful if someone could help me with this problem. > > Dataset 1: > X Y Z > 1 27 48 > 2 25 50 > 3 27 40 > 4 28 56 > > Where X is a unique number and Y and Z some variables > > Dataset 2: > X I J > 1 10 12 > 1 12 12 > 1 23 30 > 1 40 46 > 2 7 8 > 2 8 9 > 2 9 8 > 3 2 0 > 4 98 87 > 4 78 89 > Where X IS NOT this time a unique number. I and J are some variables. > > Thank you by advance > > > J?r?me Lema?tre > ?tudiant au doctorat > Universit? Laval > Qu?bec, QC > > ______________________________________________ > 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 >
venomousanimal
2005-Sep-27 20:07 UTC
[R] Binding dataframe with different length in rows and columns
Hello , How about cbind or rbind? You could create a new data frame and push yours into it. Greetz J??r??me Lema??tre schrieb:>Dear all, > >I'm trying to combine in R the two following datasets. >I'm would be very grateful if someone could help me with this problem. > >Dataset 1: >X Y Z >1 27 48 >2 25 50 >3 27 40 >4 28 56 > >Where X is a unique number and Y and Z some variables > >Dataset 2: >X I J >1 10 12 >1 12 12 >1 23 30 >1 40 46 >2 7 8 >2 8 9 >2 9 8 >3 2 0 >4 98 87 >4 78 89 >Where X IS NOT this time a unique number. I and J are some variables. > >Thank you by advance > > >J??r??me Lema??tre >??tudiant au doctorat >Universit?? Laval >Qu??bec, QC > >______________________________________________ >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 > >