## --------------------------- System Setting Start ---------------------------
## 01. Choose Directory AND Set As Working Directory
WorkingDirectory <- choose.dir()
setwd(WorkingDirectory)
## FilePath <- file.choose(WorkingDirectory)
## FilePath <- file.choose(getwd())
## dir(getwd())
## 02. loading R Script and input data
source("MyRCode.R")
rawData <- read.csv(file.choose(getwd()), header = F, sep = ',')
## 03. Record Current Date Time
DateTime <- format(Sys.time(), "%Y-%m-%d %H-%M-%S")
## --------------------------- System Setting Ended ---------------------------
## -------------------------- File Name Module Start --------------------------
# get the file name from the choosen file
FilePath <- file.choose(WorkingDirectory)
# [1] "F:\\JMP-DOE-Statistics\\Statistics-R\\Code_Data_Notes\\
# Chapter01-Code_Answer_Notes.r"
# Split File Path 2 List By 2 Backslash \\
FilePathList <- strsplit(FilePath,"\\\\")
# get the number of elements from list File Path List
FilePathListLength <- length(FilePathList[[1]])
# get the last element that is the file name
FileName <- FilePathList[[1]][FilePathListLength]
sprintf("The File Name is: ")
sprintf("%s", FileName)
## -------------------------- File Name Module Ended --------------------------