Pseudo executable for R code
R workspace management guidelines make the developer life easy. Person with fair idea about programming can run the code without difficulty. But command prompt is nightmare for non-technical person or end users; they always expect double click execution applications.
RScript is alternative way to interact with R engine. This program can be invoked from command prompt. When .R file is passed as argument, it executes commands given in it. Bat can be created which triggers .R file which in turn executes the 3 commands (source, load, main) for non-technical person with the help of RScript.
Bat file
set RPath="C:\R-2.15.2"
%RPath%\bin\RScript.exe ExecuteCalculator.R
set RPath="C:\R-2.15.2" statement reads the installation location of R. This need to be set by user. In the next statement RScript is triggered with "ExecuteCalculator.R" as argument
ExecuteCalculator.R
# This Function Automates the execute of project.
# Source the Loading Function
# Call the Loading Function
# Call the Main function and other required functions
source("LoadCalculator.R")
LoadCalculator()
Main()
cat("\n Success. Exiting now...")
Sys.sleep(30)
Chick here for sample RWorkspace