Customizing the environment. <tt>.First</tt> and <tt>.Last</tt>



next up previous contents
Next: Classesgeneric functions Up: Writing your own Previous: Recursive numerical integration

Customizing the environment. .First and .Last

Any function named .First() in the .Data directory has a special status. It is automatically performed at the beginning of an S-PLUS session and may be used to initialize the environment. For example, the definition in Figure 8 alters the prompt to $ and sets up various other useful things that can then be taken for granted in the rest of the session.

 
Figure 8:   An example of a .First() function

Similarly a function .Last(), if defined, is executed at the very end of the session. An example is given in Figure 9

 
Figure 9:   An example of a .Last() function



Erik Moledor
Tue Jan 31 21:02:18 EST 1995
s