Installing R Packages
Windows
Use the menu to install or update to the latest version on
CRAN
Linux/Unix
- Download the latest
.tar.gz file from the main web page for the package of interest (http://cran.r-project.org/), saving it to /tmp
- Run
sudo R CMD INSTALL /tmp/packagename_version.tar.gz
Note: Although debian R packages are not as up to date as ones from CRAN, there are advantages (speed being a major one) for using
apt-get to install and update packages, e.g.
apt-get install r-cran-hmisc. To get a complete list of available debian R packages use
apt-cache search r-cran*.
Installing S-Plus Libraries
NOTE: If Fortran, Ratfor, or C code for a library has not changed (and they seldom do), and you don't care about any updates in the help files, but want to update the source code for a library, download the source code from the table below. To install, first remove the system directories whatever/library/libraryname/.Data and .../.Prefs. Invoke S-Plus while the library's Data area is in search position one (either by setting that as the current working directory before invoking S-Plus, or by using attach), and issue the command source('whateverdirectory/whatfile.s'). This works for all versions of S-Plus. See these notes on updating S-Plus 6 source files on Windows.
Source S and help files (in Rd format) for S-Plus version 6 and later
Note: Once
Hmisc.rd.zip is unzipped, remove either
sas.get.windows.Rd or
sas.get.unix.Rd depending on which version you are building.
Add-on S-Plus libraries are also distributed in binary .zip files for UNIX, Linux and Windows/NT, although these are usually not as up to date as the above sources. These zip files contain Fortran, Ratfor, and C code, and help files. For Windows and Intel Linux they also contain binary S-Plus function objects. For Unix you must download the S source code separately (from this page).
Intel Windows Installation for S-Plus 2000
You might want to install the
unzip95 program for Win/NT. For easy point-and-click installation of add-on libraries under Windows get WinZip version 6.0 or later if you don't already have it (from
www.winzip.com) and associate .zip file extensions with WinZip (WinZip will set this up for you automatically if you allow it to do so). Then click on one of our .zip files and tell your browser to OPEN the file. This will invoke WinZip, which will allow you to specify a directory into which you extract the files. The directory should be something like
\splus45\library or
\sp2000\library for S-Plus 2000 for Windows. Once the correct directory is specified, click on Extract. DO NOT specify a directory such as
\sp2000\library\Hmisc as this would result in creation of a directory
\sp2000\library\Hmisc\Hmisc. For Windows, this is all you need to install add-on S-Plus libraries.
Intel Windows Installation for S-Plus 6.x
The libraries are installed by unzipping into the proper area (
..../library) just as with S-Plus 2000. Get
Hmisc.zip and
Design.zip from
http://biostat.mc.vanderbilt.edu/twiki/pub/Main/Hmisc/Hmisc.zip and
http://biostat.mc.vanderbilt.edu/twiki/pub/Main/Design/Design.zip . It is best to delete your old
.../library/Hmisc or
.../library/Design before installing the new versions.
Intel Linux Installation for S-Plus 6.x
It is recommended that you install S-Plus in an area owned by user
splus in
/home/splus. Become a member of the
splus group (e.g.,
newgrp splus if you already have permission granted) and do
cd /home/splus/library
unzip /tmp/libraryname.intel.linux
assuming that you stored the downloaded
zip file in
/tmp/libraryname.intel.linux.zip.
UNIX Installation for S-Plus 6.x
For UNIX you will have to compile Fortran/Ratfor/C code and text versions of S-Plus functions to create binary versions in
.Data. Here is an example installation process, where
libraryname is either
Hmisc or
Design. You have to get the S source files from the table above. If the commands below, it is assumed that you stored the source file in
/tmp/libraryname.s and the
zip files containing help files in
/tmp/libraryname.unix.zip. It is also assumed that the S-Plus system files are owned by group
splus of which you are a member.
newgrp splus
cd /home/splus/library
mkdir libraryname
cd libraryname
Splus CHAPTER
cd ..
unzip /tmp/libraryname.unix
cd libraryname
Splus </tmp/libraryname.s
Splus make
UNIX Installation for S-Plus 3.4
The process for installing the libraries in S-Plus 3.4 for UNIX is similar to that for 6.x. This is no longer supported but you may be able to obtain the needed
zip filesfrom the author that have the correct help file structure for S-Plus 3.4. As before, get the master source
.s from the above table. Follow the general S-Plus 3.4 instructions for creating a
Makefile to compile the
.f .r .c files and then run this
Makefile. Here is one sequence of steps.
newgrp splus
cd /home/splus/library
unzip /tmp/libraryname.unix
cd libraryname
...
create and run Makefile to compile Fortran, Ratfor, C ...
Splus </tmp/libraryname.s
Accessing the Libraries
To access the libraries, read the steps after the unzip instructions in the appropriate
README.TXT file under the page for the library of interest. For example, S-Plus commands such as the following will be useful (for R, omit the second argument to
library).
library(Hmisc,T) # attach library
help(library='Hmisc') # get help for library
.First <- function() invisible(library(Hmisc,T)) # store a .First function in your project
# _Data area to automatically get access to Hmisc
Users having S-Plus stored on a network disk will have to take other steps or have their network administrator install libraries. See README.TXT. Some network users will have to install add-ons in personal directories. These users can make such external areas easily accessible by defining a
.First function such as
.First <- function() invisible( library(Hmisc, first=T, lib.loc="/my/slibrary" ))
The material in these documents are for public distribution as long as you acknowledge the source and you keep the documents and software intact.
Note:
Hmisc.s and
Design.s source files for S-Plus were created using
makeSplusSource scripts in
~/S/foo/s. These scripts created the corresponding zipped
.Rd format help files.
--
FrankHarrell - 11 Feb, 17 Oct, 31 Oct 2004