[BioC] merge two dataframes

alex lam (RI) alex.lam at bbsrc.ac.uk
Tue Feb 13 12:58:20 CET 2007


Hi Ghislaine,

Try
x<-
merge(x1,x2,by.x="ID",by.y="ID",suffixes=c("1","2"),all.x=TRUE,all.y=TRU
E) 

Thanks,
Alex

------------------------------------
Alex Lam
PhD student
Department of Genetics and Genomics
Roslin Institute (Edinburgh)
Roslin
Midlothian EH25 9PS
Great Britain

Phone +44 131 5274471
Web   http://www.roslin.ac.uk

Roslin Institute is a company limited by guarantee, registered in
Scotland (registered number SC157100) and a Scottish Charity (registered
number SC023592). Our registered office is at Roslin, Midlothian, EH25
9PS. VAT registration number 847380013.

The information contained in this e-mail (including any attachments) is
confidential and is intended for the use of the addressee only.   The
opinions expressed within this e-mail (including any attachments) are
the opinions of the sender and do not necessarily constitute those of
Roslin Institute (Edinburgh) ("the Institute") unless specifically
stated by a sender who is duly authorised to do so on behalf of the
Institute


-----Original Message-----
From: bioconductor-bounces at stat.math.ethz.ch
[mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of Ghislaine
Guigon
Sent: 13 February 2007 09:30
To: bioconductor at stat.math.ethz.ch
Subject: [BioC] merge two dataframes

Hi,

I would try to merge 2 dataframes x1, x2 with same structure. ID is the
common columns. I don't understand why the result,  x,  is composed of
NA ?
Is someone understand the problem ?

The code is :

 > x2[1:3,]
              ID     sVOL logSignalMean
4340 8559;27*L11 3189.818    11.6392584
4335  8547;27*L9 3419.657    11.7396359
3267 6441;27*I18    0.000    -0.4460873
 > x1[1:3,]
              ID     sVOL logSignalMean
4339 8557;25*L11 2972.267    11.5373480
4334  8545;25*L9 3380.747    11.7231263
3266 6439;25*I18    0.000    -0.4460873
 > x<- merge(x1,x2,by.x=ID,by.y=ID,suffixes=c("1","2"))
 > x[1:3,]
       ID sVOL1 logSignalMean1 sVOL2 logSignalMean2
NA   <NA>    NA             NA    NA             NA
NA.1 <NA>    NA             NA    NA             NA
NA.2 <NA>    NA             NA    NA             NA

thanks,
gg



More information about the Bioconductor mailing list