This assignment is our first look at the R package system.
For general information about the R statistical computing environment see www.r-project.org, especially the Manuals.
Manuals
In particular the manuals
- An Introduction to R (also available as PDF) gives a huge amount of information for ordinary users. It would be very surprising to me if everyone in the class already knew everything in this introduction.
- Writing R Extensions (also available as PDF) gives the basic information developers, including authors of contributed packages, need to know.
- The R language definition (also available as PDF) gives language lawyer type information about the R language.
- R Installation and Administration (also available as PDF) gives information mostly useful to system administrators but also useful to users trying to install and develop R packages on their own computers.
The first part of the assignment is to read the table of contents (at least) of each of these books, so you have at least a vague idea of what they are about. The first two are by far the most important.
An R Package
The file foo_0.1-2.tar.gz is the source code for an R package. It doesn't do much — so is about as easy to understand as a package gets — but it does show what a package looks like.
The second part of the assignment is to
- Download this package.
- Install this package. Since you do not have system administrator privileges on the departmental workstations, you will have to install the package in your own account. The section Installing packages of the R Installation and Administration manual explains how.
- Use the package. Figure out how to see from inside R what the package does. At least do the example on the help page for the (one and only) function in the package. Also do another example.
- Unpack the source. This does not seem to be explained anywhere.
You are just supposed to know. It is, of course, explained in many
places on the net. (Google
tar.gz
) I will just tell you thattar zxf foo_0.1-2.tar.gzunpacks the source of the package. Now look at every file in the package. What does each do? Find the sections in Writing R Extensions that explain each one. - Check the package. The section Checking packages of the Writing R Extensions manual explains how.
Be prepared to discuss all of this in class.