What is R? “R is `GNU S' - A language and environment for statistical computing and graphics. R is similar to the award-winning S system, which was developed at Bell Laboratories by John Chambers et al. It provides a wide variety of statistical and graphical techniques (linear and nonlinear modelling, statistical tests, time series analysis, classification, clustering, ...). “R is designed as a true computer language with control-flow constructions for iteration and alternation, and it allows users to add additional functionality by defining new functions. For computationally intensive tasks, C, C++ and Fortran code can be linked and called at run time.” (from R Project for Statistical Computing Web Page) Downloading R from Web Page The R statistical analysis program is available for downloading from the web. The process for downloading and installing follows. 1. Use a web browser to access: http://cran.us.r-project.org/ 2. Under “Precompiled Binary Distributions” click on “Windows (95 and later)”. 3. Click on “base”. 4. Click on “CHANGES” to read about new features of this version. 5. Click on “README.rw1081” to read about installation and usage of this version. 6. Click on “rw1081.exe” to begin the download. This is a 22 MB file so it may take 10 minutes on a direct network connection. 7. Uninstall any previous versions of R and close all programs before completing the next step. 8. Install the file by double clicking on it. This is a Windows 2000 style installer. Follow the standard installation instructions. This will put R into your Start Menu and place an R icon on your Desktop. Installation will take 5-10 minutes. 9. At this point R is installed. When R is started, a standard Help menu is available that contains documentation on R. 10. Additional documentation is on the R web page under Documentation. Under Documentation, “Contributed” has user-contributed documentation for beginners. You may find one or more of these useful. Starting R R may be started from the Start Menu or from the Desktop icon. An important aspect in using R is to keep different projects on which you are working separated. We recommend that a separate folder be setup for each project. To start R for the first time in a project: 1. Place a copy of the Desktop R in the project folder. 2. Right click on the R icon in the folder. 3. Click on the Shortcut tab. 4. In the Start in dialog box, type the directory path for the project folder, e.g., C:\Documents\Project1 5. Start R by clicking on the R icon in the project folder. This will make R automatically reference that folder when accessing and creating data files. After have done this the first time, simply click on the R icon to begin in that project folder. Installing and using R library: psurvey.analysis 1. Obtain a copy of "psurvey.analysis_2.2.zip", which is a compressed archive (zip) file containing the library. This file may be obtained from the Aquatic Monitoring web pages or from an email. 2. Start R program. 3. Under the "packages" menu, select "Install package from local zip file" 4. Browse to find psurvey.analysis_2.2.zip and select it. Click on "Open". 5. R unzips the file and installs the package. The package is installed in a directory called ' psurvey.analysis', under the "library" subdirectory in the R software folder. This library subdirectory contains all other installed packages in the same structure. 6. Installation of the package only needs to be done once. 7. Each time R is started in a session, you have to separately "load" the package in order to access the functions and their help files. 8. To do this, click on "Packages" again and select "Load package". Then select “psurvey.analysis” from the menu and click on "OK". The package is loaded and ready for use. 9. After loading the library, help for using the functions in the library is available through the help command, i.e., enter "help(function name)" at the command line, and through the "Help" menu (click on "Help", click on "R language (standard)...", enter the function name, and click on "OK"). Help for the entire library also is available through the "Help" menu (click on "Help", click on "R language (html)", click on "Packages", and click on "psurvey.analysis"). Text Editors and R Using a text editor is recommended for use in conjunction with R. Placing all R commands used in a text file will document how the analysis was completed. If necessary, the text file can be re-executed to duplicate any result or to redo an analysis if data has changed. Notepad is available with Windows as one option. Another option is to download NoteTab Light from http://www.notetab.com/download.htm. This is the free version.