Git Product home page Git Product logo

Comments (4)

hmansell avatar hmansell commented on July 26, 2024

You can just pass the formula as a string.

from rprovider.

myso42 avatar myso42 commented on July 26, 2024

Well, I tried it, but I get an error, it complains that the objects are not found.

Example : (I just str the two objects to proff that thay are well created)

R.str(msft);;
num [1:254] -0.0041 0.01427 -0.02562 0.0134 -0.00548 ...
val it : SymbolicExpression =
RDotNet.SymbolicExpression {Engine = RDotNet.REngine;
IsClosed = false;
IsInvalid = false;
IsProtected = true;
Type = Null;}
R.str(goog);;
num [1:254] -0.00404 0.00383 -0.0208 -0.006 -0.00712 ...
val it : SymbolicExpression =
RDotNet.SymbolicExpression {Engine = RDotNet.REngine;
IsClosed = false;
IsInvalid = false;
IsProtected = true;
Type = Null;}
R.rq("msft~goog",0.5);;
Error in eval(expr, envir, enclos) : object 'msft' not found
RDotNet.ParseException: Error in the application.
at RDotNet.REngine.Parse(String statement, StringBuilder incompleteStatement) in C:\dev\Sierra\3rdParty\R.NET\src\R.NET\REngine.cs:line 455
at RDotNet.REngine.d__0.MoveNext() in C:\dev\Sierra\3rdParty\R.NET\src\R.NET\REngine.cs:line 365
at System.Linq.Enumerable.LastOrDefault[TSource](IEnumerable1 source) at RDotNet.REngine.Evaluate(String statement) in C:\dev\Sierra\3rdParty\R.NET\src\R.NET\REngine.cs:line 324 at RProvider.RInteropInternal.eval(String expr) in C:_Download\Dropbox\42.LocalCode_F#\RType Provider\FSharpRProvider\RInterop.fs:line 282 at RProvider.RInterop.callFunc(String packageName, String funcName, IEnumerable1 argsByName, Object[] varArgs) in C:_Download\Dropbox\42.LocalCode_F#\RType Provider\FSharpRProvider\RInterop.fs:line 383
at RProvider.RInterop.call(String packageName, String funcName, Object[] namedArgs, Object[] varArgs) in C:_Download\Dropbox\42.LocalCode_F#\RType Provider\FSharpRProvider\RInterop.fs:line 398
at <StartupCode$FSI_0011>.$FSI_0011.main@()
Stopped due to error

The very same line works well in R :

rq("googmsft",0.5)
Call:
rq(formula = "goog
msft", tau = 0.5)

Coefficients:
(Intercept) msft
0.0007102887 0.3720877846

Degrees of freedom: 362 total; 360 residual

from rprovider.

myso42 avatar myso42 commented on July 26, 2024

OK, found it, I need to instantiate them on R side

R.assign("msft",msft)
R.assign("goog",goog)
let res = R.rq("msft~goog",0.5)

Thx a lot for this awesome library !

from rprovider.

hmansell avatar hmansell commented on July 26, 2024

Yes - if you don't pass some other object then R expects the names to be bound in the environment.

Another way of doing this is to pass in a data.frame as the data parameter of rq. It will then bind the names in the formula to the columns of the data frame.

from rprovider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.