Re: [R] .First and .Rprofile won't run on startup

From: Rolf Turner <r.turner_at_auckland.ac.nz>
Date: Tue, 15 Jul 2008 08:10:52 +1200

On 15/07/2008, at 6:34 AM, Susan Amrose wrote:

> I'm trying to source a file automatically every time I start R. I
> tried
> adding the following .First function in a file Rprofile.site in my
> $R_HOME/etc/ directory (verified $R_HOME by Sys.getenv()) as well
> as in a
> file .Rprofile in my $HOME directory and .Rprofile in the working
> directory:
> .First <- function(){
> source(file.path(Sys.getenv("HOME"), "R", "functions","standard.r"))
> cat("Actually read your file!!!!")
> }
>
> - but no luck. I'm using a Mac (OS 10.4). It never runs (the file
> is not
> sourced and the text does not appear). Does anyone have any
> suggestions?
>
> Ideally, I would like to have a directory and source all the files
> in the
> directory in startup, but this is just a first step (is that
> possible?).

I just tried your example, i.e. I put your definition of .First() into my
.Rprofile (after creating a directory ``R'' in my home directory, a subdirectory
of that called ``functions'', and a file in that called ``standard.r'').

Started R, and ``standard.r'' was sourced --- no problema. I too am running on
a Mac --- darwin8.10.1.

So --- it's another Mac mystery. :-( Sorry that I can't be more helpful.

        cheers,

                Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 14 Jul 2008 - 20:13:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jul 2008 - 20:33:48 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive