Test for default stringsAsFactors and complain if TRUE
This commit is contained in:
parent
599f8a3f98
commit
89bdd14d1c
56
.Rprofile
56
.Rprofile
@ -1,14 +1,50 @@
|
|||||||
|
# .Rprofile
|
||||||
|
#
|
||||||
|
# This script is automatically executed on startup
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
init <- function() {
|
init <- function() {
|
||||||
source(".init.R")
|
|
||||||
|
# Create a local copy of myScript.R if required, and not been 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))
|
||||||
}
|
}
|
||||||
|
|
||||||
cat("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
|
if (! file.exists("./myScripts/.myProfile.R")) {
|
||||||
cat(" =================")
|
cat("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
|
||||||
cat("\n\n")
|
cat(" =================")
|
||||||
cat(" WELCOME !\n")
|
cat("\n\n")
|
||||||
cat("\n")
|
cat(" WELCOME !\n")
|
||||||
cat(" Type 'init()' to begin\n\n")
|
cat("\n")
|
||||||
cat("\n")
|
cat(" Type 'init()' to begin\n\n")
|
||||||
cat(" =================")
|
cat("\n")
|
||||||
cat("\n\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")
|
||||||
|
}
|
||||||
|
|
||||||
|
# [END]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user