Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

Commented Unassigned: Dataset Pass into R function C# [174]

$
0
0
Hi,

I want to pass dataset into r function in c# how its possible.

R Code :

```
fnData<-function(df)
{
ret<-df
#apply(df,1,mean)
return(df)
}
```
C# Code :

```
DataFrame df = engine.Evaluate("fnData('" + d + "')").AsDataFrame();
```
Comments: Assuming `d` is a .NET `System.Data.DataSet`, this cannot work. You need to create a DataFrame from C#; more than one way to do this. For reference to readers, the question appears related to http://stackoverflow.com/questions/30365878/how-to-pass-var-into-r-script, and includes a link to relevant sample code [DataFrameTest](https://github.com/jmp75/rdotnet/blob/master/RDotNet.Tests/DataFrameTest.cs)

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>