bch441-work-abc-units/.Rprofile

51 lines
1.4 KiB
R
Raw Normal View History

# .Rprofile
#
# This script is automatically executed on startup
# ==============================================================================
2017-08-18 20:04:01 +00:00
init <- function() {
# Create a local copy of myScript.R if not done yet.
if (! file.exists("myScript.R") && file.exists(".tmp.R")) {
file.copy(".tmp.R", "myScript.R")
cat("A new file \"myScript.R\" was created. You can use it for\n")
cat("notes and code experiments.\n\n")
}
cat("\n\n")
cat("Please open the file \".myProfile.R\" (click on the file-name in the\n")
cat("\"files\" pane), edit it, and save it into the \"myScripts\" folder.\n\n")
file.edit("ABC-units.R")
return(invisible(NULL))
2017-08-18 20:04:01 +00:00
}
if (! file.exists("./myScripts/.myProfile.R")) {
cat("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
cat(" =================")
cat("\n\n")
cat(" WELCOME !\n")
cat("\n")
cat(" Type 'init()' to begin\n\n")
cat("\n")
cat(" =================")
cat("\n\n")
} else {
cat("\n\nLoading local functions ...")
source("./myScripts/.myProfile.R")
source(".utilities.R")
cat("... done.\n\n")
}
if (default.stringsAsFactors()) {
cat("WARNING.\n")
cat("========\n")
cat("Your default \"stringsAsFactors\" parameter is set to \"TRUE\".\n")
cat("This will break some of the code.\n")
cat("Please contact your instructor to troubleshoot and fix this issue.\n")
cat("\n")
}
2017-08-18 20:04:01 +00:00
# [END]