Morning!
As/if needed, I can (per earlier comments) go with IronPython - though I'd love to continue to leverage the graphical capabilities of R in the cloud. That said - I've had run-time errors getting the worker in the air. While I can easily and happily load RDotNet (v 1.5.16) in a C# form application, I tried accessing the same common DLL (where I do the loading process) from a WorkerRoleWithQBQueue solution to no avail. A few points:
var statistics = RStatistics.Load();
The common class both applications leverage:
using System;
using System.Diagnostics;
using System.IO;
using RDotNet;
namespace Common
{
As/if needed, I can (per earlier comments) go with IronPython - though I'd love to continue to leverage the graphical capabilities of R in the cloud. That said - I've had run-time errors getting the worker in the air. While I can easily and happily load RDotNet (v 1.5.16) in a C# form application, I tried accessing the same common DLL (where I do the loading process) from a WorkerRoleWithQBQueue solution to no avail. A few points:
- When I tried installed via the NuGet Packages Manager the RDotNet package - all it would offer was v 1.5.5 Curious.
-
While the worker role solution compiles, I get a run-time error :
An unhandled exception of type 'System.TypeLoadException' occurred in Microsoft.WindowsAzure.ServiceRuntime.dll
Additional information: Could not load type 'Common.RStatistics' from assembly 'Common, Version=1.0.5424.25643, Culture=neutral, PublicKeyToken=null'.
var statistics = RStatistics.Load();
The common class both applications leverage:
using System;
using System.Diagnostics;
using System.IO;
using RDotNet;
namespace Common
{
public static class RStatistics
{
private static REngine _rEng;
public static bool Load()
{
var load = true;
try
{
if (null != _rEng)
return true;
var curDirectory = Directory.GetCurrentDirectory() + "\\rengine";
System.Environment.SetEnvironmentVariable("R_HOME", curDirectory);
var curDirectoryWithBin = curDirectory + "\\bin";
REngine.SetEnvironmentVariables(curDirectoryWithBin, curDirectory);
var rPath = curDirectory + "\\bin\\R.dll";
if (!Directory.Exists(curDirectory))
{
//get files from cloud
Trace.WriteLine("here");
}
_rEng = REngine.GetInstance(rPath, true, null, null);
}
catch (Exception ex)
{
Trace.WriteLine("Are all R DLLs present in the current directory? : " + ex.ToString());
load = false;
}
if (!load)
_rEng = null;
return load;
}
public static void Unload()
{
if(null != _rEng)
_rEng.Dispose();
}
}
}