Installing Bioconductor and finding help
In order to install Bioconductor, copy the following two lines into your R console.
This will install the core Bioconductor packages. Further packages can be installed using the
biocLite function and specifying a character vector of which packages to install. For example, to install the "affy" and "genefilter" libraries you would type:
Remember, you still need to load the library, e.g.,
library(genefilter), if you want to use the package.
More information on installing and updating Bioconductor packages can be found at:
There are many ways to find help directly from within R.
A very comprehensive help page is generated with the command
help.start() from the
command line. This gives links to manuals and manual pages for all documentation in the environment.
This documentation set is dependent on the set of packages that are installed. You may
have seen a help page for a function in a given R session, that cannot be found in
another R session of the same version. Only if the package to which the function belongs
has been installed will the help page be found.
Help for functions
Typically, every function will have its own manual page which is accessible by typing a question mark ?, followed by the function name and hitting return.
?mean ?mad example(mad) example(boxplot)
Simply typing the name of the function, without parentheses, and hitting return will show the source code of the function.
The manual page contains a description, example usage, explanation of all arguments, further details, explanation of the returned value, references, see also linking to other functions, and examples.
To read over all the help files for all functions of a given package, we can launch a clickable index in your default web browser.
If you are using RStudio, you can launch the same index within RStudio's help pane with:
Note that you need to have the package installed in order to access this documentation.
Another quick way to look up functions in a given package is to write out the package name, two ":" symbols and then trying tab-completion to get a list of functions which are exported by that package.
If you have a question about a particular object in R, you might want to look up the help for the "class" of that object, which will tell you how to construct such an object and what methods are available for manipulating such objects. For example, we can find the name of the class of an object and look up help:
class(6) ?numeric ?"numeric-class"
Sometimes, the constructor function and the class name will point to the same help page, although this is not necessarily true for all packages.
A quick way to find out what methods are available for a given class:
R has good capabilities for self-description. Classes can be formally linked to methods
that operate usefully on their instances. The methods available can be
listed using the
You can find the source code for many functions by typing out the name of the function without () and pressing enter.
Note that this just 'wraps' a call to
read.table, which is much more involved, but can
be printed to the terminal by mentioning it to the interpreter.
You might have to specify a particular class if you want source code for a method:
plotMA showMethods("plotMA") getMethod("plotMA","data.frame")
"Vignettes" are documents which accompany R packages and are required for every Bioconductor package. They typically show an example workflow of the functions of the package using "chunks" of code with descriptive text, exactly as the document you are currently reading.
You can find Bioconductor vignettes in PDF or R script form on the Bioconductor website, but they are even easier to access directly through R. Furthermore, accessing vignettes through R guarantees that the vignette is for the correct version of the package that you are using. The following code will list the names of the vignettes for a given package:
A further call to
vignette with the name of the vignette will launch a PDF viewer:
In addition, an HTML browser can be launched with links to the various vignettes of a package:
The workflows repository contains extensive computable documents describing how certain common analyses can be performed, typically involving published data from realistic studies.
- All R functions from Bioconductor packages will have manual pages and most will have running examples;
- All Bioconductor software packages will have vignettes that describe how functions work together to achieve the objectives of the package;
- Many workflow documents are available that describe how functions from different packages can be used together to complete analyses;
- R has significant built-in utilities for finding documents about basic infrastructure and statistical procedures;
- R's mailing list for elementary questions and Bioconductor's support site are useful fora with extensive archives.