[R] merge aint merging

Strumila, John John.Strumila at team.telstra.com
Wed Jul 26 09:35:56 CEST 2000


g'day R friends,

can anyone please help me with a frustrating merge?

The number of rows of a resulting merge is the smaller of the 2 dataframes
used as input.  What am I doing wrong?  I'm using 1.1.0 on redhat 6.2

thanks,
John Strumila

> xx[1:10,]
           datetime c
948992940 948992940 0
948993000 948993000 0
948993060 948993060 0
948993120 948993120 0
948993180 948993180 0
948993240 948993240 0
948993300 948993300 0
948993360 948993360 0
948993420 948993420 0
948993480 948993480 0
> yy[1:10,]
           datetime     c
948992940 948992940 16560
949317120 949317120    84
949327800 949327800    23
949330440 949330440     0
949331580 949331580    27
949332000 949332000    22
949348800 949348800     6
949351440 949351440    81
949351500 949351500   213
949351560 949351560    52
> zz<-merge(xx,yy,by="datetime")
> zz[1:10,]
    datetime c.x   c.y
1  948992940   0 16560
2  949317120   0    84
3  949327800   0    23
4  949330440   0     0
5  949331580   0    27
6  949332000   0    22
7  949348800   0     6
8  949351440   0    81
9  949351500   0   213
10 949351560   0    52
> nrow(xx)
[1] 9683
> nrow(yy)
[1] 984
> nrow(zz)
[1] 984
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list