使用R.NET创建Data.Frame [英] Creating a Data.Frame using R.NET
问题描述
我正在C#中使用R.NET项目来调用R函数.有没有一种方法可以在C#中创建DataFrame?我在这里看到一个DataFrame类型: https://rdotnet.codeplex.com/documentation
I'm using the R.NET project in C# to call R functions. Is there a way to create a DataFrame in C#? I see there is a DataFrame type here: https://rdotnet.codeplex.com/documentation
目前,我可以通过将数据(整数值)处理为一系列字符串,然后使用R.NET的评估命令,在R中创建data.frame,但是有一种方法可以推送数据(整数值)到R而不必经过字符串转换过程?
Currently I can create a data.frame in R by manipulating my data (integer values) into a series of strings and then using R.NET's evaluate command, but is there a way where I can push my data (integer values) to R without having to go through a string conversion process?
例如(我的最终问题是),是否有一种方法可以使用本机整数值在C#中创建DataFrame?
For example (and my ultimate question is), is there a way to create a DataFrame in C# using native integer values?
谢谢.
推荐答案
REngine
对象具有方法CreateDataFrame
,这是创建数据帧的首选方法.
The REngine
object has a method CreateDataFrame
, and this is the preferred way to create data frames.
您会在R.NET单元中找到测试.
You'll find example usage in the R.NET unit tests.
另一个示例可以在优化中找到日志提取实用程序
这篇关于使用R.NET创建Data.Frame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!