从研发调用.NET / C# [英] Calling .NET/C# from R
问题描述
我想用从研发一个API,仅在.NET中可用。是否有可用于从研发调用.NET C#code的标准方法?如果是这样,我怎么可以这样做?
I'd like to use an API from R that is only available in .NET. Is there a standard method that can be used to call .NET C# code from R? If so, how can I do so?
推荐答案
另一种选择,这种讨论的读者可能考虑的是 RCLR包,这是我一直在努力了几年,从R.访问任意.NET code它的 R.NET 其中,反之,是从.NET访问R的一种方式。
Another option that readers of this discussion might consider is the rClr package, which I have been working on for a couple of years to access arbitrary .NET code from R. It is a sibling of R.NET which, conversely, is a way to access R from .NET.
要给予RCLR包的味道,经典的Hello World的样子:
To give a flavour of the rClr package, the canonical "Hello World" looks like:
library(rClr)
clrLoadAssembly('c:/path/to/myassembly.dll')
myObj <- clrNew('MyNamespace.MyClass,MyAssemblyName')
clrCall(myObj, 'SayHelloWorld')
的意见和建议通过网站的欢迎。
Feedback and suggestions welcome via the web site.
这篇关于从研发调用.NET / C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!