Frequently Asked Questions About S-Plus

The .First function - what is it and why should you have one?

You can create a .First function that will run specified S-Plus commands.  For example, your .First function may open a graphics device, set postscript color options or open frequently used libraries.

For example, a .First function that opens a motif() window looks like:

Using window based help

S-Plus 3.4

Once inside Splus you can start the motif() driver and then run help.start().

S-Plus 5

The graphical help interface for S-Plus is run through netscape. The first thing you will have to do is change the default browser in your options.  At the command prompt, type options(help.browser="/usr/biostatistics/bin/netscape").

Then, when you type help.start(), the help menu will appear in a netscape window.

Creating Color Postscript plots

To create color postscript plots, you will need to specify a color scheme using ps.options. for example,

ps.options(colors = ps.colors.rgb[c("black", "CadetBlue", "LightSeaGreen", "LightSlateBlue", "red", "green", "blue", "yellow", "khaki", "maroon"),  ], background = ps.colors.rgb[c("white"),  ])

puts black as the first color, cadet blue as the second, light sea green as the third, etc., and white as the background. So, when you use col=5 in a plot command, you will plot in red. To see what colors are available, check /usr/openwin/lib/rgb.txt.

last updated: 02-04-2000
elizabeth brown