Previous: Windows | Up: Installation | Next: Examples |
You initially need to create both local R and local R library directories if they do not already exist. At the Linux/Unix command prompt in your home directory, do this by typing:
> mkdir ~/.R ~/.R/libraryThen open the `.Renviron' file that resides in your home directory, creating it if necessary, and add the line:
R_LIBS = "~/.R/library"using your preferred text editor. These steps only need to be performed once. To install the package WHATIF as well as the package that it depends upon, lpSolve, type:
> install.packages("WhatIf", dependencies = TRUE)at the R command prompt. This command installs the packages from the CRAN respository set as part of your R options. You can see what its current value is by calling
> getOption("repos")The default, `factory fresh' setting will usually prompt you to select a CRAN mirror. One alternative for installing the package WHATIF is to use Gary King's website as the repository. You can do this by typing:
> install.packages("WhatIf", repos = "http://gking.harvard.edu")A second alternative is to download the Linux/Unix bundle `WhatIf_XX.tar.gz', available from http://gking.harvard.edu/R/CRAN/src/contrib/, and place it in your home directory. Note that `XX' is the current version number. Then, at the Linux/Unix command line from your home directory, type
> R CMD INSTALL WhatIf_XX.tar.gzto install the package. Finally, you then only need to type:
> library("WhatIf")from within R to load the WHATIF package, after which you may begin working with it.