F# R Provider: Method not found: 'RDotNet.REngine RDotNet.REngine.GetInstance

廉价感情. 提交于 2019-12-11 03:59:27

问题


I am using the R Type Provider like so in the REPL

#r "../packages/FSharp.Data.2.2.0/lib/net40/FSharp.Data.dll"
open FSharp.Data

[<Literal>]
let uri = "https://reddoggabtest-secondary.table.core.windows.net/TestTelemetryData0?tn=TestTelemetryData0&sv=2014-02-14&si=GabLab&sig=GGc%2BHEa9wJYDoOGNE3BhaAeduVOA4MH8Pgss5kWEIW4%3D"

type CarTelemetry = XmlProvider<uri>
let carTelemetry = CarTelemetry.Load(uri)

#r "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.5.1/System.Xml.Linq.dll"
open System.Xml.Linq

carTelemetry.Entries |> Seq.iter(fun e -> printfn "%A" e.Title)

#I "../packages/RProvider.1.1.8/lib"
#r "../packages/R.NET.1.5.5/lib/net40/RDotNet.dll"
#r "../packages/R.NET.1.5.5/lib/net40/RDotNet.NativeLibrary.dll"
#r "../packages/R.NET.Community.FSharp.0.1.9/lib/net40/RDotNet.FSharp.dll"
#r "../packages/RProvider.1.1.8/lib/net40/RProvider.dll"
#r "../packages/RProvider.1.1.8/lib/net40/RProvider.Runtime.dll"

open System
open System.Net

open RDotNet
open RProvider
open RProvider.graphics
open RProvider.stats

carTelemetry.Entries |> Seq.map(fun e -> e.Content.Properties.Acceleration.Value)
                     |> R.log
                     |> R.diff

When I execute it, I am getting this exception

System.MissingMethodException: Method not found: 'RDotNet.REngine RDotNet.REngine.GetInstance(System.String, Boolean, RDotNet.StartupParameter, RDotNet.Devices.ICharacterDevice)'.
   at RProvider.Internal.RInit.engine@114.Invoke()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at RProvider.RInteropInternal.toR(Object value) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 287
   at RProvider.RInterop.passArg@447(List`1 tempSymbols, Object arg) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 461
   at RProvider.RInterop.argList@468-1.GenerateNext(IEnumerable`1& next) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 475
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)
   at RProvider.RInterop.callFunc(String packageName, String funcName, IEnumerable`1 argsByName, Object[] varArgs) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 466
   at <StartupCode$FSI_0012>.$FSI_0012.main@()
Stopped due to error

Any ideas? Thanks.


回答1:


This looks like some version mismatch - what version(s) of R.NET do you have installed in the packages folder?

The correct ones (as required by the latest R provider NuGet package) are:

  • R.NET.Community (= 1.5.16)
  • R.NET.Community.FSharp (= 0.1.9)

Note that there is (confusingly) also older R.NET package (without the "Community" bit) and having that in packages can probably confuse the R provider.

BTW: You can also try using the FsLab templates instead, which makes the process of installing & loading everything a lot simpler - reduces all to just a single #load :-)



来源:https://stackoverflow.com/questions/30043036/f-r-provider-method-not-found-rdotnet-rengine-rdotnet-rengine-getinstance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!