I just started using rdotNetfrom: http://rdotnet.codeplex.com/ . I have never used R before, but I can do simple arithmetic in it. I was able to instantiate and do some simple numerical calculations in C #. My problem is that I read in a CSV file and create dataframe. The information is loaded correctly, and I can see it when I am debugging.
When I try to go through the data framework and print the contents on the screen, the first iteration shows me the correct information, but after that it seems that instead of numbers, it actually turns out to be a number.
Since I can do basic calculations in the solution, I will not write the begging code that will create the REngine instance. I will show how I read the file in which I am located in the debug folder of the application: Location of the downloaded csv file that I use: http://www.rqtl.org/sampledata/listeria.csv
engine.Evaluate("library(datasets)");
engine.Evaluate("dataset1 <- read.csv(file = \" listeria.csv\", header = TRUE, sep = ',')");
DataFrame dataset1 = engine.GetSymbol("dataset1").AsDataFrame();
// Here is the problem
for (int row = 0, row < dataset1.RowCount; row++)
{
for ( int col = 0; col < dataset1.ColumnCount; k++)
{
Console.Writeline(dataset1[row,col])
}
}
My question is: can someone tell me that I'm doing something wrong or is there another way to get through dataframein rdotNetto get the information.
I hope I explained everything. If you need more information, please feel free to ask.
Built in:
Visual Studio 2013, using a console Application, framework 4.5.1, RdotNet DLL: Vers 1.5.5 and in Win 7 64 Bit
source
share