从 R 调用 .NET/C# [英] Calling .NET/C# from R
问题描述
我想使用仅在 .NET 中可用的 R API.是否有可用于从 R 调用 .NET C# 代码的标准方法?如果是这样,我该怎么做?
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 代码.它是 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.
这篇关于从 R 调用 .NET/C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!