I have a C# application which needs a Deedle Frame as input data. I also have a R script that return a data frame, and I don't want to re-implement the algorithm in R script by C#. I tried using R.Net, I can get the data frame from R script in C# application, but its type is RDotNet.DataFrame. Is there any to convert RDotNet.DataFrame to Deedle Frame in C# code?
I am also thinking about creating a F# dll library that calls the R script, then use that dll library in C# code. Is it possible?
If you use Deedle from F#, then you can also use the R type provider. The two are nicely integrated and you can call R from F# and get back a Deedle data frame. There is a good example on this in the Deedle documentation.
R provider will automatically turn R data frames into Deedle frames. For example:
open RProvider.datasets
// Get mtcars as a typed Deedle frame
let mtcars : Frame<string, string> = R.mtcars.GetValue()
The source code that does the conversion in R provider and Deedle is available too. So if you wanted to use it directly, the place to start is the tryCreateFrame
function in Deedle source code.
This is not really exposed to C# at this point, but we would certainly welcome a pull request making this possible for Deedle :-).