P
pulyka
Guest
I have Visual Studio 2017, RdotNet version v4.0.30319, R version 3.4.1
Tried to create the example program:
using RDotNet;
namespace tryR
{
class Program
{
static void Main(string[] args)
{
string result;
string input;
REngine engine;
REngine.SetEnvironmentVariables(rPath:"P:\\Program Files\\R-3.4.1\\bin\\i386", rHome:"P:\\Program Files\\R-3.4.1");
engine = REngine.GetInstance();
engine.Initialize();
//input
Console.WriteLine("Please enter the calculation");
input = Console.ReadLine();
//calculate
CharacterVector vector = engine.Evaluate(input).AsCharacter();
result = vector[0];
//clean up
engine.Dispose();
//output
Console.WriteLine("");
Console.WriteLine("Result: '{0}'", result);
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}
and when running the code, I got the error message: The program '[11012] tryR.exe' has exited with code 2 (0x2). when executing the REngine.GetInstance(); statement
(I tried to launch R from the above directory and it started correctly).
Thanks for any advice
Continue reading...
Tried to create the example program:
using RDotNet;
namespace tryR
{
class Program
{
static void Main(string[] args)
{
string result;
string input;
REngine engine;
REngine.SetEnvironmentVariables(rPath:"P:\\Program Files\\R-3.4.1\\bin\\i386", rHome:"P:\\Program Files\\R-3.4.1");
engine = REngine.GetInstance();
engine.Initialize();
//input
Console.WriteLine("Please enter the calculation");
input = Console.ReadLine();
//calculate
CharacterVector vector = engine.Evaluate(input).AsCharacter();
result = vector[0];
//clean up
engine.Dispose();
//output
Console.WriteLine("");
Console.WriteLine("Result: '{0}'", result);
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}
and when running the code, I got the error message: The program '[11012] tryR.exe' has exited with code 2 (0x2). when executing the REngine.GetInstance(); statement
(I tried to launch R from the above directory and it started correctly).
Thanks for any advice
Continue reading...