To see All the content (not just objects) in a package in R

r

Solution

My preferred approach by far is to simply look at the source code of a package in question.

In fact, I actually do that pretty often as running CRANberries creates a local CRAN mirror as a side effect. But even if you don't, CRAN packages really are only a quick download away and will come with comments in the source which the parsed code excludes.

Edit: I just found what Ben found too: Sean Davis' page at http://watson.nci.nih.gov/~sdavis/tutorials/TCGA_data_integration/ -- looks like it uses some BioC packages too. I would still study the source which often has more comments, annotations, extras, ... than the installed package. But maybe that's just my preference. YMMV as they say.

Problem

This is likely a newbie's question but I think I did my homework and yet have not found the answer (I hope to find) so I am posting it here to seek some assistance. Similar questions were asked before but from what I found, no answer could help me with the current issue except an "expensive" solution, which requires an editor for R. I learned that `ls` and `objects` allow us to view the objects inside a package. But even with `ls(all.names=TRUE)`, I still couldn't see all the content. Someone suggested `ls(getNAMEspace)` but still this isn't "good" enough for me. e.g. ``` >search() [1]".GlobalEvn" "package:TCGAGBM" >ls("package:TCGAGBM") character(0) >ls(getNamespace("TCGAGBM"),all.names=TRUE) [1]"._NAMESPACE_." "._S3MethodsTable_." ".packageName" ``` However, under C (cmd), I see the following C:\Users\XYZ\Documents\R\R-2.15.1\library\TCGAGBM . .. data extdata ...... (total 3 File(s), 7 Dir(s)) I came across this "discrepancy" when I saw the following line of script - ``` >clinical=read.delim(system.file( +"extdata/Clinical/clinical_patient_public_GBM.txt.gz", +package="TCGAGBM"), header=TRUE) ``` Thus I was wondering if there is a way under R to see ALL the content within a package so that we could "know" how better to utilize the package. Vignette would probably help, but in my limited experience with R so far, I have found that some packages did not come with Vignette. Any comment will be appreciated to help me learn more about R.

Original source