1\name{getHdata}
2\alias{getHdata}
3\title{
4  Download and Install Datasets for \pkg{Hmisc}, \pkg{rms}, and Statistical
5  Modeling
6}
7\description{
8  This function downloads and makes ready to use datasets from the main
9  web site for the \pkg{Hmisc} and \pkg{rms} libraries.  For \R, the
10  datasets were stored in compressed \code{\link{save}} format and
11  \code{getHdata} makes them available by running \code{\link{load}}
12  after download.  For S-Plus, the datasets were stored in
13  \code{data.dump} format and are made available by running
14  \code{data.restore} after import.  The dataset is run through the
15  \code{\link{cleanup.import}} function to reduce multiple inheritance
16  problems for SV4 (S-Plus 5 or later).  Calling \code{getHdata} with no
17  \code{file} argument provides a character vector of names of available
18  datasets that are currently on the web site.  For \R, \R's default
19  browser can optionally be launched to view \verb{html} files that were
20  already prepared using the \pkg{Hmisc} command
21  \code{html(contents())} or to view \file{.txt} or \file{.html} data
22  description files when available.
23}
24\usage{
25getHdata(file, what = c("data", "contents", "description", "all"),
26         where="http://biostat.mc.vanderbilt.edu/twiki/pub/Main/DataSets")
27}
28\arguments{
29  \item{file}{
30    an unquoted name of a dataset on the web site, e.g. \samp{prostate}.
31    Omit \code{file} to obtain a list of available datasets.
32  }
33  \item{what}{
34    specify \code{what="contents"} to browse the contents (metadata) for
35    the dataset rather than fetching the data themselves.  Specify
36    \code{what="description"} to browse a data description file if
37    available.  Specify \code{what="all"} to retrieve the data and see
38    the metadataand description.
39  }
40  \item{where}{
41    \acronym{URL} containing the data and metadata files
42  }
43}
44\details{
45  For S-Plus, Hmisc defines a function \code{download.file} that is used
46  by \code{getHdata}.  This is a stripped-down version of the \R
47  \code{\link{download.file}} function that uses the system
48  \command{wget} executable for fetching files from the Internet.  For
49  Unix and Linux systems, \command{wget} will be pre-installed usually.
50  For windows S-Plus systems, get \command{wget} from
51  \url{ftp://sunsite.dk/projects/wget/windows}.  Once you unzip the file
52  from there, move \command{wget.exe} to the same Windows directory that
53  contains \command{ftp.exe}.
54}
55\value{
56  \code{getHdata()} without a \code{file} argument returns a character
57  vector of dataset base names.  When a dataset is downloaded, the data
58  frame is placed in search position one and is not returned as value of
59  \code{getHdata}.
60}
61\author{Frank Harrell}
62\seealso{
63  \code{\link{download.file}}, \code{\link{cleanup.import}},
64  \code{\link[foreign:read.S]{data.restore}}, \code{\link{load}}
65}
66\examples{
67\dontrun{
68getHdata()          # download list of available datasets
69getHdata(prostate)  # downloads, load( ) or data.restore( )
70                    # runs cleanup.import for S-Plus 6
71getHdata(valung, "contents")   # open browser (options(browser="whatever"))
72                    # after downloading valung.html
73                    # (result of html(contents()))
74getHdata(support, "all")  # download and open one browser window
75datadensity(support)
76attach(support)     # make individual variables available
77getHdata(plasma,  "all")  # download and open two browser windows
78                          # (description file is available for plasma)
79}
80}
81\keyword{interface}
82\keyword{data}
83