2) Download and Install R Package Sand.

  1. Create 2 directories in My Documents (usually on the Desktop) called myrlib and rmain (Case sensitive)
  2. Create a copy of the R shortcut by right clicking and select copy, then paste it in My Documents/rmain directory
  3. Right click the new R shortcut and select properties.
  4. The location of Rgui.exe must be in the Target Location Box. To check this right click on R-Icon and then left click on Properties. You should see "C:\Program Files\R\R-2.6.0\bin\Rgui.exe" in the Target Field under the Shortcut tab.
    I add --sdi My Target Location looks like this:

    "C:\ProgramFiles\R\R-2.6.0\bin\Rgui.exe" --sdi
  5. The Start In Box must contain the complete path to rmain folder---for this example
    "C:\Documents and Settings\User Name\My Documents\rmain ".

  6. Download sand_1.4.zip and dotFirst.R (Error in dotFirst.R corrected on 16May07) by right clicking on each link, selecting "save target as" and then place these files in the My Documents/rmain folder. REPLACE dotFirst.R if asked.
  7. If you DO NOT HAVE WRITE PERMISSION in R program folder Open dotFirst.R under Notepad or Wordpad and replace path_to on line 9 with your own path.
    FOR THIS EXAMPLE path_to is "C:/Documents and Settings/User Name/My Documents/Myrlib"
    If you have sand Version 1.0, 1.1, 1.2, or 1.3 installed change update to TRUE on line 1 in dotfirst.R
    Save the changes and close Notepad.

    If you DO HAVE WRITE PERMISSION Open dotfirst.R and change write to TRUE in line 1 and sand will be installed in the standard R library folder (see comments in dotfirst.R for details).

  8. Now run R by double clicking on the R-Icon in My Documents/rmain folder.
  9. Left click on File in upper left corner (see below) of the R Console and select Source R code.
  10. Step 2 - parts I through J
  11. Left click on dotfirst.R and then left click on the Open Box (lower right). Once dotfirst.R is sourced in type: .First(TRUE) and press [Enter] on the R command line. This will remove the old version of sand(if there is one), install the new sand package (Version 1.4) and attach it to the current session.  If you exit R the next time you run R the .First function will run and attach the sand package (see step l below).
  12. To access the help menu for the SAND package type the name of the function or dataset you are interested in preceded by a ? For example in the R console type ?IH.Summary and press [Enter] will open the help file and give examples at the bottom on how to utilize this function.  Type ?sand [Enter] will open the help file for sand package-- see also Item 4 on main page. 
  13. To end the R session select Exit from the file menu or type q() and press [Enter] after the prompt.  BE SURE TO ANSWER Yes to the question "Save workspace image"

Developed For U. S. DOE, Office of Health, Safety, and Security
Last Modified 5 Nov 2007 (touches: 181324 )
URL http://www.csm.ornl.gov/esh/statoed/
  ORNL | Directorate | CSM | NCCS | User Info (CCS) | Disclaimer | Search