Re: [R] where is "average shifted histogram"?

From: Martin Maechler <>
Date: Thu 29 Jul 2004 - 17:32:17 EST

>>>>> "PD" == Peter Dalgaard <> >>>>> on 29 Jul 2004 08:02:54 +0200 writes:

    PD> Eckart Bindewald <> writes:
>> Hello! In the book Modern Applied Statistics with S (4th
>> ed), section 5.6 the concept of the "average shifted
>> histogram" or ASH is mentionend. Also it is mentioned in
>> the same section "The code used is in the scripts for
>> this chapter" (from figure caption 5.8, analysis of the
>> geyser duration data). *However*, I have trouble finding
>> the code for that function! Admittedly, I am a newby to
>> R. Where exactly do I find the scripts to that chapter?
>> Commands like library(MASS), or"average
>> shifted histogram") did not help.

    PD> The scripts are in simple files installed with the
    PD> package. So you need to go to the install directory and
    PD> read them from there. A canonical way of finding it from
    PD> within R is

    PD> .path.package("MASS")

which requires that "MASS" has been attached {as by library()}.

    PD> dir(file.path(.path.package("MASS"),scripts))     PD>"MASS"),"scripts","ch05.R"))

eehm, as the "." in ".path.package()" suggests, there should be a more canonical way --- and there is, using system.file() :

 dir(system.file("scripts", package = "MASS"))

 ## [1] "ch01.R" "ch02.R" "ch03.R" "ch04.R" "ch05.R" "ch06.R" "ch07.R" "ch08.R"
 ## [9] "ch09.R" "ch10.R" "ch11.R" "ch12.R" "ch13.R" "ch14.R" "ch15.R" "ch16.R"
 ##[17] "README""scripts","ch05.R"), package = "MASS"))


______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Thu Jul 29 17:39:50 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:41:14 EST