Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am using R.Net Nuget package for R functionality in .Net.I can read csv files and save in dataframe and can do calculations.But I want to do calculations with data that I have already in a datatable or List(dotnet) without using csv.csv contains some rows and columns.I have same data in datatable.Now I want to use this datatable data in rengine to do calculation.Help me.Please go through the following code.
C#
DataTable blmValues = ReadFromCsv(fileName, separator);
            ds.Tables.Add(blmValues);
REngine.SetEnvironmentVariables();
            REngine engine = REngine.GetInstance();
            engine.Initialize();
            engine.Evaluate("library(quadprog)");
ataFrame dataset = engine.Evaluate("ds.DF").AsDataFrame();
Posted
Comments
BillWoodruff 12-Nov-14 7:17am    
You are using R.Net, latest version ? In a Console App ?

Using which .NET Framework version ?
Aradhana Krishna 12-Nov-14 7:19am    
Yes ..I am using latest version of R.Net .I am using windows Application..framework is 4.0
BillWoodruff 12-Nov-14 8:00am    
In a Console Application, correct ?
Aradhana Krishna 12-Nov-14 8:02am    
no...in a windows form application.In .cs
BillWoodruff 12-Nov-14 8:04am    
I am puzzled by this: if you can read a .csv file and use its data, can't you use the same technique to read the data produced by some form of query (Linq) that transforms the data in the DataTable to a format like that of a .csv file ?

In other words, do you have a sense of what is holding you back right now in using the data in the DataTable ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900