HH (version 2.1-28)

hh: Resolve filenames relative to the HH directory.

Description

The pathnames in the HH package for all the datasets referenced in Heiberger and Holland (2004) are given relative to the 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.

Usage

hh(file)
hh.file(file)
hh.file.DOS(file, displayForCutAndPaste=TRUE)

Arguments

file
Character string giving the pathname of a file. For 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 when
displayForCutAndPaste
Logical value. When TRUE (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 fo

Value

  • Fully expanded, absolute pathname for the input filename. hh 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.

Details

The datasets from the Heiberger and Holland (2004) online files are all given paths relative to the beginning of the 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 http://springeronline.com/0-387-40270-5. The 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.

References

Heiberger, Richard~M. and Holland, Burt (2004b). Statistical Analysis and Data Display: An Intermediate Course with Examples in S-Plus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0-387-40270-5.

Examples

Run this code
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