简体   繁体   English

MacOS上F#中的RProvider错误:无法重现基本示例

[英]RProvider bug in F# on MacOS: cannot reproduce basic example

running RProvider1.1.20 on a Terminal window on MacOS 在MacOS的“终端”窗口上运行RProvider1.1.20

I try to run the example from http://bluemountaincapital.github.io/FSharpRProvider/mac-and-linux.html 我尝试从http://bluemountaincapital.github.io/FSharpRProvider/mac-and-linux.html运行示例

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

> R.sin(1.0);;

val it : RDotNet.SymbolicExpression = [1] 0.841471 值:RDotNet.SymbolicExpression = [1] 0.841471

all work fine 一切正常

However >R.sin(1.0);; 但是>R.sin(1.0);; Error in base::sin(0, 1) : 2 arguments passed to 'sin' which requires 1 base :: sin(0,1)中的错误:2个参数传递给'sin',需要1

RDotNet.EvaluationException: Error in base::sin(0, 1) : 2 arguments passed to 'sin' which requires 1 RDotNet.EvaluationException:base :: sin(0,1)中的错误:2个参数传递给'sin',需要1

at RDotNet.REngine.Parse (System.String statement, System.Text.StringBuilder incompleteStatement) [0x000a0] in :0 at RDotNet.REngine+d__0.MoveNext () [0x0008f] in :0 at System.Linq.Enumerable.LastOrDefault[TSource] (System.Collections.Generic.IEnumerable 1[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.FSharpFunc 2[T,TResult] f) [0x0007e] in <57161c90b86b2a10a7450383901c1657>:0 at RProvider.RInteropInternal.eval (System.String expr) [0x0000c] in <57161c90b86b2a10a7450383901c1657>:0 at .$FSI_0028.main@ () [0x00046] in <23b88108285f4035b1dcf54f78a47062>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:Inte 在RDotNet.REngine.Parse(System.String语句,System.Text.StringBuilder incompleteStatement)处[0x000a0]在RDotNet.REngine + d__0.MoveNext()处的:0在System.Linq.Enumerable.LastOrDefault [ TSource](System.Collections.Generic.IEnumerable 1[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.FSharpFunc 2 [T,TResult] f)在<57161c90b86b2a10a7450383901c1657>:0中的[0x0007e]在RProvider.RInteropInternal.eval(System.String expr)[0x0000c]在<57161c90b86b2a10a7450383901c1657>:0中的。$ FSI_0028.main46() <23b88108285f4035b1dcf54f78a47062>:0在(包装器托管到本机)System.Reflection.MonoMethod:Inte rnalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in :0 Stopped due to error rnalInvoke(System.Reflection.MonoMethod,object,object [],System.Exception&)在System.Reflection.MonoMethod.Invoke(System.Object obj,System.Reflection.BindingFlags invokeAttr,System.Reflection.Binder活页夹,System.Object [ ]参数,System.Globalization.CultureInfo文化)[0x00038]在:0中由于错误而停止

I first wondered if it had to do with regional settings (comma or dot separator for numbers) but the example with 0.1 and 1.0 suggest otherwise 我首先想知道它是否与区域设置(数字的逗号或点分隔符)有关,但是带有0.1和1.0的示例建议不这样做

this is a x-post as I also posted this issue in the RProvider GitHub here https://github.com/BlueMountainCapital/FSharpRProvider/issues/186 这是x-post,因为我也将此问题发布在RProvider GitHub上,这里https://github.com/BlueMountainCapital/FSharpRProvider/issues/186

thanks to @s952163 感谢@ s952163

it IS a regional setting problem. 这是一个地区性的问题。 So if your global environment is in English you shouldn't have this bug. 因此,如果您的全球环境是英语,则不应有此错误。

Even though it's not a very satisfying answer, i will mark this as an answer for the time being. 即使这不是一个令人满意的答案,但我暂时会将其标记为答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM