Packages

If you use R enough, eventually you will want to perform a specialized calculation. There is a community of people who distribute software via packages, so what you need may already exist.

Lots of Packages

5700 packages on CRAN, then there’s BioConductor and Github

CRAN

Comprehensive R Archive Network

Main page: Many books, reference cards, and short documents (in a variety of languages)

Task Views

Human curated lists of packages and why you might want to use them.

Example: Genetics One of the subdivisions: Importing sequence data, links to, amoung others, the seqinr package.

A First Look at a Package: seqinr.

Follow link to the package (or get it from a web search)

Installing the Package

You need to install the package on your system. This need only be done once —or when there are updates— no matter how many times you use the package.

Loading the Package

This you need to do every time you use the package. If you are using R-arkdown, be sure to require() the package in your document.

A nice way to do this is to create a chunk with directive {r include=FALSE} to avoid including in your document the numerous messages that are generated when a package is loaded.

NOTE: Even though it’s called “loading a package,” don’t use load() to do it. Use require() or library(). (It doesn’t really matter which.) The load() function does something quite different, involving bringing previously created objects (such as data frames) into R.

Criteria for Evaluating Packages

No Vignettes

Try a web search on using seqinr R or whatever the package is called. You may find articles, books that use the package, tutorials. Why aren’t these vignettes? Probably because they were written by someone other than the package authors.

R Bloggers and other Blogs

This is a good way to find out about new developments.

FAQ

  1. How do you transfer packages when you update R.