Using . interactively

When you use the . program it issues a prompt when it expects input commands. The default prompt is ``>'', which on Unix could be the same as the shell prompt, and so it may appear that nothing is happening. However, as we shall see, it is easy to change to a different . prompt if you wish. In these notes we will assume that the Unix shell prompt is ``$ ''.

In using . under Unix the suggested procedure for the first occasion is as follows:

1.
Create a separate sub-directory, say work, to hold data files on which you will use . for this problem. This will be the working directory whenever you use . for this particular problem.

mkdir work

cd work

2.
Place any data files you wish to use with . in work.

3.
Start the . program with the command

R

4.
At this point . commands may be issued (see later).

5.
To quit the . program the command is

q()

At this point you will be asked whether you want to save the data from your R session. You can respond yes, no or cancel (a single letter abbreviation will do) to save the data before quiting, quit without saving, or return to the . session. Data which is saved will be available in future . sessions.

Further . sessions are simple.

1.
Make work the working directory and start the program as before: cd work

R

2.
Use the . program, terminating with the q() command at the end of the session.

When using . under either the Macintosh or Windows the procedure to follow is basically the same. Create a folder or working directory. Copy files that you want to use to that directory. Then launch R by double clicking on the appropriate icon. Select New from the File menu to indicate that you want to start a new analysis (this will remove any previously defined objects from the workspace) and then select Save from the File menu to save the pristine image into the folder you have created. You may now commence your analysis and when you exit from R you will be prompted to save the image in your working directory.

To work on the same analysis at a later time simply double-click on the icon for the saved image. Alternatively you can start . elsewhere and then use Open from the File menu to select and subsequently open the saved image.



Jeff Banfield
2/13/1998