简体   繁体   中英

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

running RProvider1.1.20 on a Terminal window on MacOS

I try to run the example from http://bluemountaincapital.github.io/FSharpRProvider/mac-and-linux.html

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

> R.sin(1.0);;

val it : RDotNet.SymbolicExpression = [1] 0.841471

all work fine

However >R.sin(1.0);; Error in base::sin(0, 1) : 2 arguments passed to 'sin' which requires 1

RDotNet.EvaluationException: Error in base::sin(0, 1) : 2 arguments passed to 'sin' which requires 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 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

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

this is a x-post as I also posted this issue in the RProvider GitHub here https://github.com/BlueMountainCapital/FSharpRProvider/issues/186

thanks to @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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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