What happens when R starts?
19 What happens when R starts?
loads itself it parses some start up files that allow the
user to store user changes to the environment and frequently used
commands. The documentation for these files is accessed with the
In particular, the user may store frequently used commands in a file
. This file is searched for in the current
directory and if not found the users home directory. This file should
code. There are special functions though. If the
are found, they are executed
as the first (or last) thing done in an R
session. As a simple
example, if the .RProfile
.First <- function() print("Hola")
.Last <- function() print("Hasta La Vista")
Then when starting R
and quitting your screen might look something
R is free software and comes with ABSOLUTELY NO WARRANTY.
[Previously saved workspace restored]
Save workspace image? [y/n/c]: n
 "Hasta La Vista"
Process R:2 finished...
More useful things for this file are of course quite possible.
Copyright © John Verzani, 2001-2. All rights reserved.