F#R Provider:未找到方法:' RDotNet.REngine RDotNet.REngine.GetInstance

时间:2015-05-05 01:56:34

标签: f#

我在REPL

中使用R Type Provider
#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

当我执行它时,我得到了这个异常

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

有什么想法吗?感谢。

1 个答案:

答案 0 :(得分:3)

这看起来有些版本不匹配 - 您在packages文件夹中安装了哪些版本的R.NET?

正确的(根据latest R provider NuGet package的要求)是:

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

请注意,还有(令人困惑的)旧的R.NET包(没有“社区”位),并且packages中的那个可能会混淆R提供商。

顺便说一句:您也可以尝试使用FsLab templates,这样就可以安装&amp;加载所有内容更简单 - 将所有内容简化为一个#load: - )