2017-08-18 20:04:01 +00:00
|
|
|
# .init.R
|
|
|
|
# Functions to initialize this collection of learning units
|
|
|
|
# Boris Steipe
|
|
|
|
# ====================================================================
|
|
|
|
|
|
|
|
# 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")
|
|
|
|
}
|
|
|
|
|
2017-09-12 20:09:20 +00:00
|
|
|
# If it doesn't exist yet, set up a profile:
|
|
|
|
if (! file.exists(".myProfile.R")) {
|
|
|
|
# setup profile data
|
|
|
|
cat("\nPlease enter the requested values correctly, no spaces, and\n")
|
|
|
|
cat("press <enter>.\n")
|
|
|
|
e <- readline("Please enter your UofT eMail address: ")
|
|
|
|
n <- readline("Please enter your Student Number: ")
|
|
|
|
|
|
|
|
conn <- file(".myProfile.R")
|
|
|
|
writeLines(c(sprintf("myEMail <- \"%s\"", e),
|
|
|
|
sprintf("myStudentNumber <- %d", as.numeric(n))),
|
|
|
|
conn)
|
|
|
|
close(conn)
|
|
|
|
rm(e, n, conn)
|
|
|
|
}
|
|
|
|
|
|
|
|
source(".myProfile.R")
|
|
|
|
|
2017-08-18 20:04:01 +00:00
|
|
|
source(".utilities.R")
|
|
|
|
|
|
|
|
file.edit("ABC-units.R")
|
|
|
|
|
|
|
|
# [End]
|