S-plus libraries

S-plus libraries are collections of S-plus objects that are available to many users. We have set up an S-plus library for this class on the H: drive of the StatLab server. Libraries are divided into sections, and within each section there is a collection of related data frames, functions, matrices and other S-plus objects. On this page we illustrate many of the S-plus library commands, by giving an example of using the Stat200 library.


Current contents of the library.

The S-plus command used to find the contents of the Stat200 library is,

> library(lib.loc="h:\\classes\\stat200")

This command will open a text editor window and display the contents of the library. A second text editor window will open giving the contents of the S-plus default library.

The S-plus command used to find help on the nhcensus section of the library is,

> library(help="nhcensus",lib.loc="h:\\classes\\stat200")

This opens a text-editor window with details of the contents of the nhcensus section of the library.

The S-plus command used to attach the nhcensus section of the library is,

> library(nhcensus,lib.loc="h:\\classes\\stat200")

The S-plus commands to find the contents of the library are,

> search() # Find the position of the library on search list

If the position on the search list was [9], then to find the contents of the library you would type the following. If the position is any other position just replace the number with the appropriate one.

> objects(9)

An alternative command to find the contents of the library is:

> ls(pos=9)

For help on any of the objects in the library (NHages, for example) simply type,

> help(NHages)
 

This page was last revised: November 5th, 1997.