1
Vote

Exception at REngine.SetEnvironmentVariables() call

description

Hi,

I am getting an exception at REngine.SetEnvironmentVariables() in my below code, may I know how can I check the environment variables are set correctly.
static void Main(string[] args)
        {
            REngine.SetEnvironmentVariables(); // <-- May be omitted; the next line would call it.

            //REngine.SetDllDirectory(@"C:\Program Files\R\R-2.12.0\bin\i386");
            REngine engine = REngine.GetInstance();
            // A somewhat contrived but customary Hello World:
            CharacterVector charVec = engine.CreateCharacterVector(new[] { "Hello, R world!, .NET speaking" });
            engine.SetSymbol("greetings", charVec);
            engine.Evaluate("str(greetings)"); // print out in the console
            string[] a = engine.Evaluate("'Hi there .NET, from the R engine'").AsCharacter().ToArray();
            Console.WriteLine("R answered: '{0}'", a[0]);
            Console.WriteLine("Press any key to exit the program");
            Console.ReadKey();
            engine.Dispose();
        }

file attachments

comments