[R-SIG-Finance] NEW: rDotNet package
Jonathan Shore
jonathan.shore at gmail.com
Wed Aug 30 21:56:00 CEST 2017
Hi,
I’ve published a new package on CRAN called “rDotNet”. The package allows one to call to .NET based code seamlessly from R, with .NET objects appearing as S4-style object proxies in the R session. A similar package using this framework was made available for Python as well. From R one can:
1. Create an instance of any .NET type (whether C#, F#, or otherwise)
2. Call methods on a type
3. Call functions (static methods / functions in modules)
4. Get / Set properties
One interacts with the package as:
require (rDotNet)
## optional initialization (dll location can also be set with an environment var)
.cinit (dll=“~/Dev/MyModels.dll”)
## create object
obj <- .cnew(“com.stg.models.UnivariateHawkes”, 10.0, 1e-2, 1e-3)
## call method “F” on the object
excitation <- obj$F (2.5)
I may add the ability to inline F# or C# code into R files at some point (much in the way Rcpp does), but for now requires that your F# or C# functions be compiled into a .NET assembly.
For more information:
- https://github.com/tr8dr/.Net-Bridge <https://github.com/tr8dr/.Net-Bridge>
And the R package is available on CRAN:
- https://cran.r-project.org/package=rDotNet <https://cran.r-project.org/package=rDotNet>
Finally, the package has been tested on OS X (where I do most of my work), Linux, and Windows. Note that for unix systems “mono” or .NET core must be installed. See the installation instructions for more information.
regards
Jonathan
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list