Hello,

Comme intitulé, je cherche à lancer des scripts R via C#. Pour cela j'ai trouvé qlq sources qui utilisent System.Diagnostics.Process :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "E:/R/bin/Rscript.exe";
proc.StartInfo.WorkingDirectory = "E:/R/bin/";
proc.StartInfo.Arguments = "E:/R/bin/test.r";
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
La question qui en découle : comment récupérer le résultat renvoyé par Rscript.exe ? Y-a-t'il un moyen via ce processus créé ? Ou je dois faire une bidouille type fichier texte ou autre ?

Merci de vos lumières !