Entering edit mode
Heidi Dvinge
★
2.0k
@heidi-dvinge-2195
Last seen 10.3 years ago
Hello Peng,
please keep discussions to the list, so that other people can chime in
as
well.
I'm not familiar with the details of xtable, but in the example you
link
to below it seems like the function xtable.matrix() does exist, but
it's
not exported by the name space. However, simply using xtable() works
fine
for me, and gives the same result at calling xtable.matrix()
specifically
(code shown below).
There might be an updated version of the examples from "Bioinformatics
and
Computational Biology Solutions Using R and Bioconductor" somewhere;
someone else can probably tell you. My best advice though is, that
when
something doesn't work, simply do a search for that function/package
;)
Typing ?xtable.matrix gives you the xtable help page, which a.o. says
"The
available method functions for xtable are given by methods(xtable)."
Regards
\Heidi
> library(GO.db)
> library(xtable)
> methods(xtable)
[1] xtable.anova* xtable.aov* xtable.aovlist*
xtable.coxph*
[5] xtable.data.frame* xtable.glm* xtable.lm*
xtable.matrix*
[9] xtable.prcomp* xtable.summary.aov*
xtable.summary.aovlist* xtable.summary.glm*
[13] xtable.summary.lm* xtable.summary.prcomp* xtable.table*
xtable.ts*
[17] xtable.zoo*
Non-visible functions are asterisked
> goTerms <- contents(GOTERM)
> goCats <- sapply(goTerms, Ontology)
> gCnums <- table(goCats)[c("BP","CC", "MF")]
> gCmat <- matrix(as.integer(gCnums), dimnames=list(c("BP","CC","MF"),
"Number of terms"))
> xtable.matrix(gCmat, display=c("d","d"), caption="Number of GO
terms
per ontology.", label="ta:GOprops")
Error: could not find function "xtable.matrix"
> xtable:::xtable.matrix(gCmat, display=c("d","d"), caption="Number of
GO
terms per ontology.", label="ta:GOprops")
% latex table generated in R 2.9.0 by xtable 1.5-5 package
% Sun Aug 9 13:17:48 2009
\begin{table}[ht]
\begin{center}
\begin{tabular}{rr}
\hline
& Number of terms \\
\hline
BP & 16067 \\
CC & 2297 \\
MF & 8506 \\
\hline
\end{tabular}
\caption{Number of GO terms per ontology.}
\label{ta:GOprops}
\end{center}
\end{table}
> xtable(gCmat, display=c("d","d"), caption="Number of GO terms per
ontology.", label="ta:GOprops")
% latex table generated in R 2.9.0 by xtable 1.5-5 package
% Sun Aug 9 13:17:59 2009
\begin{table}[ht]
\begin{center}
\begin{tabular}{rr}
\hline
& Number of terms \\
\hline
BP & 16067 \\
CC & 2297 \\
MF & 8506 \\
\hline
\end{tabular}
\caption{Number of GO terms per ontology.}
\label{ta:GOprops}
\end{center}
\end{table}
> sessionInfo()
R version 2.9.0 (2009-04-17)
i386-apple-darwin8.11.1
locale:
en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xtable_1.5-5 GO.db_2.2.11 RSQLite_0.7-1
DBI_0.2-4
AnnotationDbi_1.6.0
[6] Biobase_2.4.1
loaded via a namespace (and not attached):
[1] tools_2.9.0
> Hi Heidi,
>
> I have figured out how to change the package names. But there are
> still some command that is not running, for example 'xtable.matrix'
in
> the script that I pointed out in my orginal post.
>
> Could you please take a look how to correct these commands?
>
> Regards,
> Peng
>
> On Sun, Aug 9, 2009 at 2:58 AM, Heidi Dvinge<heidi at="" ebi.ac.uk="">
wrote:
>> Hi Peng,
>>
>> in general, all the annotation package now have an ".db" ending to
>> reflect
>> an underlying change to a database structure. In this particular
case
>> you'd therefore want GO.db, but the same would apply to e.g.
KEGG.db,
>> and
>> all the chip annotation packages (moe430a.db, hgu133a.db,
>> mogene10stprobeset.db etc.).
>>
>> Please see
>> http://www.bioconductor.org/packages/release/AnnotationData.html
for all
>> the annotation packages.
>>
>> Best
>> \Heidi
>>
>>
>>> Hi,
>>>
>>> The examples in "Bioinformatics and Computational Biology
Solutions
>>> Using R and Bioconductor" are outdated. For example, I don't find
the
>>> package "GO" in
>>> http://www.bioconductor.org/mogr/chapter-code/metaOverview.R
>>>
>>> I'm wondering if somebody can help updated the examples to reflect
the
>>> changes in BioC in the last 4 years.
>>>
>>> Regards,
>>> Peng
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>