R - Startup (Script) - Rprofile
Table of Contents
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.
Articles Related
Management
Location
The system wide .Rprofile is searched in:
- R_HOME/etc/Rprofile.site
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
path.expand("~")
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:
library(ORE)
# 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)
Documentation / Reference
help(.Rprofile)
help(Startup)