Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

Commented Unassigned: REngine.CreateInstance("RDotNet") Fails in F# [51]

$
0
0
following the example from the main page using F# (script), I did this:

'#r "C:\TFS\Tff.RDotNetExample_Solution\packages\R.NET.1.5.3\lib\net40\RDotNet.dll"
'#r "C:\TFS\Tff.RDotNetExample_Solution\packages\R.NET.1.5.3\lib\net40\RDotNet.NativeLibrary.dll"

open System.IO
open RDotNet

let environmentPath = System.Environment.GetEnvironmentVariable("PATH")
let binaryPath = @"C:\Program Files\R\R-3.0.1\bin\x64"
System.Environment.SetEnvironmentVariable("PATH",environmentPath+System.IO.Path.PathSeparator.ToString()+binaryPath)

let engine = RDotNet.REngine.CreateInstance("RDotNet")


and when I run it, I get:

System.ArgumentException: Value does not fall within the expected range.
at RDotNet.REngine.CreateInstance(String id, String dll)
at <StartupCode$FSI_0010>.$FSI_0010.main@() in C:\TFS\Tff.RDotNetExample_Solution\Tff.RDotNetExample\RDirectExample.fsx:line 12
Stopped due to error

Any ideas?
Comments: I had similar problem in C#. It looks for me that something wrong with default parameters in CreateInstance, so it is needed to define the second parameter explicitly, like CreateInstance("MyRDot", "RDotNet"). In my case, the program stops to throw exception. However, I am still not able to Initialize() created instance. I suspect, that the same problem - wrong default par processing - bugs here too, and so far has not find a solution. Anyway, adding a param is worth to try, I think

Viewing all articles
Browse latest Browse all 1634

Trending Articles