How can I find out from which library my R object is from?

Viewed 229

I am still a bit puzzled by how namespaces are handled in R. In particular, I work with the Bioconductor ecosystem, where lot's of stuff from various libraries that I didn't explicitly load are being called in the background.
Concretely, I am using the oligo package to read in .cel files and it returns me an HTAFeatureSet object, of which I have no idea from which package it comes from. A simple google search wasn't very helpful either, I just get results on how to use these objects but not from which library it is from.

Is there a function in R, similar to ? or class that returns the library of an object, so I can read more about the idea behind this object?

2 Answers

Without having installed package and examined the class structure, since we were not provided any example data: In general, any class will have methods associated with it.

methods(class = "HTAFeatureSet")

The list will then have accessible help pages through ?, and the package where the function comes from will be listed in the upper left corner. E.g.

?print.HTAFeatureSet

Note that accessing help for any method available for the class will require that the class name is included in the search after the dot.

A very useful tool for learning to work with unfamiliar classes is to examine the structure of object.

str(yourvariablewithdata)

In analyses of genomic data in R, some classes store data in a form of a list or a data.frame. Such elements can then be directly manipulated with the respective methods. In other cases, such as class DNAbin (package ape), the data are stored in a bit-level format and data manipulation is easier using provided functions.

Okay - I did some searching. So Bioconductor contains A LOT of packages. Like thousands. I'm not sure which ones you've imported. But I would start by looking here: https://www.bioconductor.org/packages/release/BiocViews.html#___Software for your HTAFeatureSet. Since this seems to be a pretty niche work-space, there probably won't be much information outside of the Bioconductor website. Most R packages though will have a CRAN page associated with them. You could try that also.

Related