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

New Post: DatemTime reading immposible.

$
0
0
Hello, i have file with following content:
TimeStamp;Val;
2012-12-18 00:00;17,5
2012-12-18 00:15;18,2
2012-12-18 00:30;18,2
2012-12-18 00:45;17,5
I open this file this way:
engine.Evaluate("data<-read.csv('C:/data.csv', header=T, sep=\";\", dec=\",\")");
and then try to read data this way:
DataFrame df = engine.GetSymbol("data").AsDataFrame();
                for (int rowIndex = 0; rowIndex < df.RowCount; rowIndex++)
                {
                    for (int colIndex = 0; colIndex < df.ColumnCount; colIndex++)
                    {
                       object time2 = df[rowIndex, colIndex];
                       string time = df[rowIndex, colIndex].ToString();
                    }
                    Console.Write(Environment.NewLine);
                }
but time is formated into numeric values like 1,2,3,4 ...
But before converstion when I look into df DataFrame, there seems be right value look:
Image

and after conversion
Image

Any help how to read correct time value ? I think that RdotNet or R engine, is created indexing table and putting this values there listing here only ids to these values. like if I would have few times the same value in my TimeStamp column, there would be the same ids.

Viewing all articles
Browse latest Browse all 1634

Trending Articles



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