R - Startup (Script) - Rprofile

1 - About

Code can be called during the initialization of an R session.

For more information on the initialization sequence of R on startup, type help(Startup) in the R Console.

3 - Management

3.1 - Location

The system wide .Rprofile is searched in:

  • R_HOME/etc/Rprofile.site
R.home(component = "home")

The user .Rprofile file is searched by order of precedence in:

  • the R_PROFILE_USER environment
  • the current directory
  • or in the user's home directory

4 - Example

  • add the following lines of code to the Rprofile.site file located below the top-level R installation directory <R_HOME>\etc\Rprofile.site:
# Change the following connection settings:
user     <- "scott"
password <- "tiger"
sid      <- "mysid"
host     <- "myhost"
port     <- 1521
all      <- TRUE
cat("Connecting to ORE\n")
cat("    User:", user, "\n")
cat("    SID: ", sid, "\n")
cat("    Host:", host, "\n")
ore.connect(user, sid, host, password, port, all)

5 - Documentation / Reference

lang/r/startup.txt ยท Last modified: 2018/06/11 20:36 by gerardnico