AnnotatedDataFrame and cbind
1
0
Entering edit mode
Simon Anders ★ 3.7k
@simon-anders-3855
Last seen 3.7 years ago
Zentrum für Molekularbiologie, Universi…
Hi I've got two objects of class AnnotatedDataFrame and would like to combine them in the style of 'cbind'. How is this done? Is there really no method defined for 'cbind' and 'AnnotatedDataFrame' or am I overlooking something? What I mean is that this here works with ordinary data.frames: > df1 <- data.frame( A=1:5 ) > df2 <- data.frame( B=11:15 ) > cbind( df1, df2 ) A B 1 1 11 2 2 12 3 3 13 4 4 14 5 5 15 I'd expect hence that this should work, too: > library( Biobase ) > adf1 <- new( "AnnotatedDataFrame", df1 ) > adf2 <- new( "AnnotatedDataFrame", df2 ) > cbind( adf1, adf2 ) adf1 adf2 [1,] ? ? Is there maybe something else defined? Thanks. Simon +--- | Dr. Simon Anders, Dipl.-Phys. | European Molecular Biology Laboratory (EMBL), Heidelberg | office phone +49-6221-387-8632 | preferred (permanent) e-mail: sanders at fs.tum.de
Biobase Biobase • 740 views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 16 days ago
United States
in man page for AnnotatedDataFrame-class: combine is used; cbind is perhaps too suggestive for this more complex structure On Thu, Oct 21, 2010 at 12:01 PM, Simon Anders <anders at="" embl.de=""> wrote: > Hi > > I've got two objects of class AnnotatedDataFrame and would like to combine > them in the style of 'cbind'. How is this done? > > Is there really no method defined for 'cbind' and 'AnnotatedDataFrame' or am > I overlooking something? > > > What I mean is that this here works with ordinary data.frames: > >> df1 <- data.frame( A=1:5 ) >> df2 <- data.frame( B=11:15 ) >> cbind( df1, df2 ) > ?A ?B > 1 1 11 > 2 2 12 > 3 3 13 > 4 4 14 > 5 5 15 > > I'd expect hence that this should work, too: > >> library( Biobase ) >> adf1 <- new( "AnnotatedDataFrame", df1 ) >> adf2 <- new( "AnnotatedDataFrame", df2 ) >> cbind( adf1, adf2 ) > ? ? adf1 adf2 > [1,] ? ? ?? > > Is there maybe something else defined? > > Thanks. > > ?Simon > > > > +--- > | Dr. Simon Anders, Dipl.-Phys. > | European Molecular Biology Laboratory (EMBL), Heidelberg > | office phone +49-6221-387-8632 > | preferred (permanent) e-mail: sanders at fs.tum.de > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENT
0
Entering edit mode
Hi Vince On 10/21/2010 06:12 PM, Vincent Carey wrote: > in man page for AnnotatedDataFrame-class: combine is used; cbind is > perhaps too suggestive for this more complex structure Thanks, I tried this, and it didn't work. The reason seems to be that combine tries to automagically determine if I want to do 'rbind' or 'cbind' by looking at the dimnames. I wanted to add several columns in one go, and to use 'combine' for this, it seems, I first have to make the rownames match. Okay, maybe this is just safe. Simon
ADD REPLY

Login before adding your answer.

Traffic: 698 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6