Sunday, 15 January 2012

How do I use user-created R functions inside F#? -


I have my own R function which I would like to use in F # How do i do this

  open RPO open open RDNnetnet F1 = R.val (R. PRSE (text = "function (x) x + 1")). AsFunction () // I hope to give me the following line 5 but this f1 ([| 4 |]) does not work  

function, you have to give value to R by using the type provider. Then, call the function passed in the data on the R-side, and finally return the result to F #:

  let res = r.sapply (rc (4), f1) .AsInteger () [0]  

This product has the following output

val f1: function

val res: int = 5

You can find more information about

, showing a detailed example of the moving technology through data walking, which contains data. Frame:


No comments:

Post a Comment