Search code examples
rrprofile

Rprofile.site can't work


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?


Solution

  • 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>