1

在 MacOS 的终端窗口上运行 RProvider1.1.20

我尝试从 http://bluemountaincapital.github.io/FSharpRProvider/mac-and-linux.html运行示例

R.mean([1;2;3;4)] R.x11() R.sin(1)

> R.sin(1.0);;

验证它:RDotNet.SymbolicExpression = [1] 0.841471

一切正常

但是 >R.sin(1.0);; base::sin(0, 1) 中的错误:传递给 'sin' 的 2 个参数需要 1

RDotNet.EvaluationException:base::sin(0, 1) 中的错误:传递给 'sin' 的 2 个参数需要 1

在 RDotNet.REngine.Parse (System.String 语句,System.Text.StringBuilder 不完整语句) [0x000a0] 在 :0 在 RDotNet.REngine+d__0.MoveNext () [0x0008f] 在 :0 在 System.Linq.Enumerable.LastOrDefault[ TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00042] in <2392cff65f724abaaed9de072f62bc4a>:0 at RDotNet.REngine.Evaluate (System.String statement) [0x0000d] in <bc069eb3146d4bcda8475794f512037f>:0 at RProvider.RInteropInternal+eval@292.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00026] in <57161c90b86b2a10a7450383901c1657>:0 at RProvider.Internal.Logging.logWithOutput[a] (RProvider.CharacterDeviceInterceptor characterDevice, Microsoft.FSharp.Core.FSharpFunc2[T,TResult] f) [0x0007e] in <57161c90b86b2a10a7450383901c1657>:0 at RProvider.RInteropInternal.eval (System.String expr) [0x0000c] in <57161c90b86b2a10a7450383901c16507>:0 at .$FSI0._0在 <23b88108285f4035b1dcf54f78a47062>:0 处(包装器托管到本机) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) 在 System.Reflection.MonoMethod.Invoke (System.Reflection.对象 obj,System.Reflection.BindingFlags invokeAttr,System.Reflection.Binder binder,System.Object[] 参数,System.Globalization.CultureInfoculture) [0x00038] in :0 由于错误而停止

我首先想知道它是否与区域设置(数字的逗号或点分隔符)有关,但 0.1 和 1.0 的示例建议不然

这是一个 x-post,因为我也在 RProvider GitHub 上发布了这个问题 https://github.com/BlueMountainCapital/FSharpRProvider/issues/186

4

1 回答 1

2

感谢@s952163

这是一个区域设置问题。所以如果你的全球环境是英文的,你就不应该有这个错误。

尽管这不是一个非常令人满意的答案,但我暂时将其标记为答案。

于 2017-05-13T13:34:38.707 回答