Introduction
The R PRG library provides a very simple scripting language. It can be used to automate some tasks.
The example below is from the GALILEI platform and shows how a script can help to make tests:
sub Cluster(dev):
GALILEIApp.SetTest(dev)
GALILEIApp.SetMeasureParam("Documents Similarities","Multi-space","DeviationRate",dev)
Session.GroupDocs()
Simulator.CompareIdeal("Topics Evaluation")
sub TestConfig(name,minprof,maxprof,nbdocs):
GALILEIApp.SetOutput(name)
Session.SetRand("1")
Simulator.SetSimulationParam("NbProfMin",minprof)
Simulator.SetSimulationParam("NbProfMax",maxprof)
Simulator.SetSimulationParam("NbOK",nbdocs)
Simulator.SetSimulationParam("NbKO",nbdocs)
Simulator.StartSimulation()
GALILEIApp.PrintOutput("Sets","Recall","Precision","Adjusted Rand Index")
for devs from -2 to 12 step 0.05:
Cluster(devs)
GALILEIApp.PrintOutput()
GALILEIApp.PrintOutput()
Session=new GSession(true,true,true,true)
Simulator=new GSimulator()
TestConfig("/home/pfrancq/test.txt",0,0,0)
Main Classes
The R::RInterpreter provides an interpreter that can execute a scripting program.
You can add whatever classes that you need by inheriting from R::RPrgClass and R::RPrgFunc.