About DOE Button Organization Button News Button Contact Us Button
Link: Energy home page
Science and Technology Button Energy Sources Button Energy Efficiency Button The Environment Button Prices and Trends Button National Security Button Safety and Health Button
OFFICE OF HEALTH, SAFETY AND SECURITY HEALTH AND SAFETY PROGRAMS
Statistical Analysis of Non-detect Data (SAND)
Home
Step 1 - Download R
Step 2 - Download and Install the sand package
Step 3 - Run sand examples
Acknowledgements
Health and Safety
HSS Logo

 
Text size: Smaller - Normal - Larger - Largest You are Here:  DOE > HSS > HealthSafety

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.2\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.2\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 ".
    Step 2 - parts d through e

  6. Download sand_1.3.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 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).

    If you have sand Version 1.0 or 1.1 installed change update to TRUE on line 1 in dotfirst.R
    Save the changes and close Notepad.
  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.1) 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"


This page was last updated on July 14, 2008


  Security & Privacy Notice   •   HSS Information Inventory   •   HSS Organization                                      
The White House FirstGov.gov FirstGov.gov Spanish Version E-gov IQ FOIA
U.S. Department of Energy | 1000 Independence Ave., SW | Washington, DC 20585
1-800-dial-DOE | f/202-586-4403 |