Re: R-alpha: Postscript and .First

Martin Maechler (maechler@stat.math.ethz.ch)
Wed, 22 May 96 13:26:42 +0200


Date: Wed, 22 May 96 13:26:42 +0200
Message-Id: <9605221126.AA03468@>
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: Jim Lindsey <jlindsey@luc.ac.be>
In-Reply-To: <9605220809.AA15857@alpha.luc.ac.be> (message from Jim Lindsey on
Subject: Re: R-alpha: Postscript and .First


    Jim> (1) For .First and .Last, what I did was to create a file called
    Jim> .First in the directory where I run R (along side .RData). At
    Jim> first, I only put the options() command for treatment contrasts
    Jim> in, but when I saw this had no effect, I put a print("Hello")
    Jim> command in as well. Then, I also checked .Last with a print()
    Jim> command as well. A colleague also checked independently on his
    Jim> Linux machine. Have I misunderstood something?

Yes, you misunderstood.
 .Rdata is a 'binary' file that contains EVERYTHING and is created by
 quit("yes")

What you must do to use a non-default .First is the following:

    shell%  R
    ....
    ...
    > .First <- function() { cat("Hello, Jim! This is .First\n") }
    >  quit("yes")

			    # See that .Rdata is different now:
    shell%  ls -l .Rdata

    shell%  R

and now you see the new .First in action

-- Martin
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-