These are notes that were turned into a book: Using R for Introductory Statistics, published Fall 2004 by Chapman Hall/CRC Press. The book is a substantial improvement. These notes are left up as they are a bit cheaper.
The simpleR package is now inside the UsingR package available from
CRAN. In the Windows GUI, this may be installed from a menubar
item. Otherwise, the following command
> install.packages("UsingR")
will work if you have sufficient permissions to install a package, or have set up R to install to a local area.
[If the links below don't work, click here to reload the page]
19 What happens when R starts?
When R 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 command help(Startup).In particular, the user may store frequently used commands in a file called .RProfile. This file is searched for in the current directory and if not found the users home directory. This file should contain R code. There are special functions though. If the functions .First or .Last are found, they are executed as the first (or last) thing done in an R session. As a simple example, if the .RProfile file was
.First <- function() print("Hola")
.Last <- function() print("Hasta La Vista")
Then when starting R and quitting your screen might look something
like
R is free software and comes with ABSOLUTELY NO WARRANTY. ... [Previously saved workspace restored] [1] "Hola" > q() Save workspace image? [y/n/c]: n [1] "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.

