options()$HH.ROOT.DIR
directory.
The pathnames for all the executable files in the online
files accompanying Heiberger and Holland (2004) are given relative to
the options()$HHfile.ROOT.DIR
directory.hh(file)
hh.file(file)
hh.file.DOS(file, displayForCutAndPaste=TRUE)
hh
, the file is in the HH package and the pathname is
relative to options()$HH.ROOT.DIR
, the installed
location of the HH package. The option is set automatically whenTRUE
(the
default) the function hh.file.DOS
prints the full pathname with
the "\" file separator convention so it can be picked up and
pasted into an editor that
uses the MS DOS convention fohh
and hh.file
use the separator convention of
the file.path
function. hh.file.DOS
returns the pathname using the
"\\" separator convention. When displayForCutAndPaste
is TRUE
, hh.file.DOS
prints the full pathname with
the "\" convention, so it can be picked up and pasted into an editor that
uses the MS DOS convention for file paths.hh
directory,
which must be stored as options()$HH.ROOT.DIR
.
If you installed the HH datasets as part of the R or S-Plus HH package, then
option options()$HH.ROOT.DIR
is set automatically.
The code listings in Heiberger and Holland (2004) are
all given paths relative to the beginning of the hh.file
directory,
which must be stored as options()$HHfile.ROOT.DIR
.
Most of the files are designed to be entered at the command line, and
are not designed to be sourced. The primary use of the hh.file
functions
is to display the pathname of the file so it can be opened for use in an editor.
The online files must be independently downloaded from the book's web site
HHfile.ROOT.DIR
option must be set by the user to correspond
to the location where the files are stored. The book recommends
options(HHfile.ROOT.DIR="c:/HOME/hh")
in Windows or
options(HHfile.ROOT.DIR="/usr/users/hh")
in Unix.
See Appendix B of Heiberger and Holland (2004) for further details.
The options(HHfile.ROOT.DIR="something"
statement
may need to be modified to match the location of the online files directory on
your machine. If you use more than one computer, you may need a
different value for the HHfile.ROOT.DIR
option on each machine. This
is the only change you will need to make in order to run any of our
software or examples. The hh
, hh.file
, and
hh.file.DOS
functions are not changed.hotdog <- read.table(hh("datasets/hotdog.dat"), header=TRUE)
## Define the HHfile.ROOT.DIR option first.
## Define
## options(HHfile.ROOT.DIR="c:/HOME/hh") ## value recommended in Appendix B
## before using the hh.file() functions.
hh.file("relativefilepath")
hh.file.DOS("relativefilepath")
hh.file.DOS("relativefilepath", displayForCutAndPaste=FALSE)
Run the code above in your browser using DataCamp Workspace