[BioC] coerce biomaRt martTable into data frame

Wolfgang Huber huber at ebi.ac.uk
Fri Oct 7 16:35:12 CEST 2005


Dear Georg,

try

   as.data.frame(top.genes at table)

or

   cbind(top.genes at id, as.data.frame(top.genes at table))

Note that you can use the "slotNames" or "str" function to inspect an 
object´s internal structure. We will add an as.data.frame method to 
future versions biomaRt, or even get rid of the "martTable" class 
completely (in favor of a simple data frame), that is not fully decided yet.

Best wishes
  Wolfgang



Georg Otto wrote:
> Hi,
> 
> I have a problem working with the biomaRt package:
> 
> I have a list of probe IDs that are differentially expressed in an
> affymetrix experiment. From this I created a martTable with annotation
> data using:
> 
> top.genes<-getGene(id=genes, array="zebrafish", mart=mart)
> 
> This works fine, but now I want to create data frame out of the
> top.genes object, because I would like to have the results in a
> table. However:
> 
> 
>>as.data.frame(top.genes)
> 
> 
> Results in the following error:
> 
> Error in as.data.frame.default(top.genes) : 
>         cannot coerce class "martTable" into a data.frame
> 
> 
> My question is: How can I coerce a martTable into a data frame? I
> understand that this might be a more general R question, but maybe
> somebody could give me a hint.
> 
> I am running
> 
> R version 2.1.0, 2005-05-12, powerpc-apple-darwin7.9.0 
> 
> biomaRt 1.2.0
> 
> Thanks a lot!
> 
> Georg
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor


-- 
Best regards
   Wolfgang

-------------------------------------
Wolfgang Huber
European Bioinformatics Institute
European Molecular Biology Laboratory
Cambridge CB10 1SD
England
Phone: +44 1223 494642
Fax:   +44 1223 494486
Http:  www.ebi.ac.uk/huber



More information about the Bioconductor mailing list