1

my system :debian in console: nano /home/tiger/R-2.15.1/etc/Rprofile.site
here is my content:

.First <- function(){    
     cat("\nWelcome at", date(), "\n")
     }

.Last <- function(){
    cat("\nGoodbye at ", date(), "\n")
    }

when i save it ,reopen my R , why there is no
Welcome at Sun Jul 15 07:53:58 2012 in my R?

Peng Peng
  • 1,305
  • 3
  • 16
  • 20

1 Answers1

1

Double-check which files are being read. Works here via ~/.Rprofile. Using

edd@max:~$ tail -4 .Rprofile

.First <- function(){
    cat("\nWelcome at", date(), "\n")
}

gets the welcome message out:

edd@max:~$ R -q

Welcome at Sat Jul 14 20:36:57 2012 
R> 
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • i made tries in window+R and debian+R: 1.window +R: place : c:/R/r-2.15.1/etc/Rprofile.site when i open R,i can get Welcome at data() when i close R,nothing to happen 2. debian+R: whether open or close R,nothing happen. – Peng Peng Jul 15 '12 at 13:19
  • Re-read the introductory manuals (eg R Installation). Re-read `help(Startup)`. This *not* rocket science, and `~/.Rprofile` is a simple shorthand for `/home/$USER/.Rprofile` where `$USER` is your login. – Dirk Eddelbuettel Jul 15 '12 at 14:45