S-Plus on the U Cluster

S-Plus 6.1 is a powerful statistical package designed for interactive and non-interactive use. While programming in S-Plus is more complex than SPSS, SAS, or Minitab, its structure allows users to generate their own routines, thereby increasing the range of capability of the package. S-Plus requires a thorough understanding of statistics. S-Plus files are installed in /usr/local/splus. Documentation for S-Plus can be examined in CCIT 112, Research Support.

Running an S-Plus Command File

To run SPlus noninteractively on the U cluster, create a command file using your preferred editor (e.g., emacs, vi, ne, pico). Click here to view a sample S-Plus program. To execute an Splus command file, at the default system prompt (usually ">") type

  
  Splus < myfile.s > myfile.out
where myfile.s is the name of the file containing S-Plus commands, and myfile.out is the name of the file containing output. Note that the first letter of the command Splus is capitalized and there is no hyphen. The ">" symbol is needed to redirect output into a file.

Running S-Plus Interactively

S-Plus may be run interactively in an X-terminal window. If you connect to the U cluster using ssh, you may or may not need to run the xhost command and set the DISPLAY environment variable. Documentation for setting up your display is available online. To run S-Plus, type

     Splus
You will receive a response like the following:


S-PLUS : Copyright (c) 1988, 2002 Insightful Corp.
S : Copyright Lucent Technologies, Inc.
Version 6.1.2 Release 2 for Sun SPARC, SunOS 5.6 : 2002 
Working data will be in /home/u1/pjones/MySwork 

>

Then, type your commands at the ">" prompt.

Using Graphics

If you will be using graphics, you will have to bring up a Motif window. In interactive mode this is done by typing


     motif()

at the ">" prompt.

To close the graphics window, type


     dev.off()

at the ">" prompt.

If you wish to create a graphics file instead, you can create a PostScript file with the command


    postscript("graph.ps")
    plot ...

where graph.ps is the name of the file you wish to create (here, graph.ps) and plot represents your plotting command. You can view the plot using ghostview or print it using the a2ps command.

Getting Help in S-Plus

If you know the name of the function you need help for, type


     help(functionname)

where functionname is the name of the function you need information for. You can also bring up a browser with a complete listing of functions for which help is available by typing help.start() on the command line. You must have your DISPLAY variable set to display to your local machine for the browser to display correctly. If you do not manually set the variable, you may have just a partial display of your help window.

Exiting S-Plus

In interactive mode, type q() to exit S-Plus.

Updated August 27, 2003