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