I have used Rscript ruer but its not working.
public static string SetupPath(string Rversion = "R-3.2.3")
{
var oldPath = System.Environment.GetEnvironmentVariable("PATH");
var rPath = System.Environment.Is64BitProcess ?
string.Format(@"C:Program FilesRR-3.2.3binx64", Rversion) :
string.Format(@"C:Program FilesRR-3.2.3bini386", Rversion);
if (!Directory.Exists(rPath))
throw new DirectoryNotFoundException(
string.Format(" R.dll not found in : {0}", rPath));
var newPath = string.Format("{0}{1}{2}", rPath,
System.IO.Path.PathSeparator, oldPath);
System.Environment.SetEnvironmentVariable("PATH", newPath);
retu newPath.ToString() ;
}
This button_clcick method calls the rscript ruer. protected void Button1_Click(object sender, EventArgs e) { string s = SetupPath(); string args = ""; string r = @"D:scr1.r"; var RcodeFilePath = string.Format(@"D:scr1.r", "R-3.2.3");
//string c = RScriptRuer.RunFromCmd(RcodeFilePath, s);
string c = RScriptRuer.RunFromCmd(r, "rscript.exe");
Label1.Text = c;
}
