Skip to the content of the web site.

Starting/interrupting/quitting

If you want to install R on your PC, please click here. Follow the instructions carefully.

Starting R

Once you have installed R on your PC, simply open the package to begin. The RGui should immediately open. Unless otherwise stated, all commands given in this tutorial are written in the command window (called the R Console in Windows). This window should be open in the RGui once you have started R in Windows. A picture is given below. Screen 1 Unlike R in UNIX, command-line editing is available, making it easy to make changes to your commands as you enter them. You may also want to save your commands at the end of your session. To do this, just left click on the File menu and select Save to File... . This is shown in the picture below.

You can then save all of your commands in a file located in the directory of your choice. Screen 2

If you are running an intensive program, you can run it using BATCH mode only if you have Perl installed (and in your path). Click here for more information.

Interrupting R

To interrupt an R command, use Esc button to stop execution of the command. This will return you to the R prompt.

Quitting R

To quit R, type:> q() or simply close the R package. When you quit R, you will be asked whether you want to save the workspace image. The workspace image includes all objects that have been created in that session. If you answer "yes", all of the objects you have created are saved and are available the next time you start R. If you answer "no", all objects are removed.

To change where your workspace image is stored, left click on Change dir... before you have quit R. This is shown in the image below.

Screen 3

You can then browse your directories to determine where you would like to save the workspace image. This allows for multiple workspace images and is useful if you are working on different projects. The next time you run R and you want the objects associated with a specific project, you must then change to the directory where the workspace image is stored in the same manner.

CAUTION: It is not advisable to rely on saving the workspace image so that all objects are saved and ready for your next R session. For instance, you may overwrite a particular object and then can't remember how that object was obtained. In general, it is recommended that you save your commands by selecting Save to File... in the File menu. In this case, all objects can then be easily input into future R sessions. The following tutorial is used to provide a basic introduction to R in a Windows environment. For more information regarding problems that may be encountered when using R in a Windows environment, a FAQ is given here.



Last Modified:  Friday 29 June 2007