當前位置: 首頁>>代碼示例>>C#>>正文


C# REngine.CreateDataFrame方法代碼示例

本文整理匯總了C#中RDotNet.REngine.CreateDataFrame方法的典型用法代碼示例。如果您正苦於以下問題:C# REngine.CreateDataFrame方法的具體用法?C# REngine.CreateDataFrame怎麽用?C# REngine.CreateDataFrame使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RDotNet.REngine的用法示例。


在下文中一共展示了REngine.CreateDataFrame方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestDataFrameInMemoryCreation

 private static void TestDataFrameInMemoryCreation(REngine engine)
 {
     IEnumerable[] columns;
     string[] columnNames;
     DataFrame df;
     createTestDataFrame(engine, out columns, out columnNames, out df);
     df = engine.CreateDataFrame(columns, columnNames: null);
     columns[1] = new int[] { 1, 2, 3, 4, 5, 6, 7 };
     try
     {
         df = engine.CreateDataFrame(columns, columnNames: null);
     }
     catch (Exception ex)
     {
         counter++;
         Console.WriteLine(string.Format("Caught an exception ({0})", counter));
         Console.WriteLine(ex.ToString());
     }
     Console.WriteLine("Recovered from evaluation exception?");
 }
開發者ID:xumaoxuan,項目名稱:rdotnet,代碼行數:20,代碼來源:Program.cs

示例2: createTestDataFrame

 private static void createTestDataFrame(REngine engine, out IEnumerable[] columns, out string[] columnNames, out DataFrame df)
 {
     columns = createTestDfColumns();
     columnNames = new[] { "Category", "No.", "Measure" };
     df = engine.CreateDataFrame(columns, columnNames: columnNames);
 }
開發者ID:xumaoxuan,項目名稱:rdotnet,代碼行數:6,代碼來源:Program.cs

示例3: ReproInMemoryDataFrameCreation

        private static void ReproInMemoryDataFrameCreation(REngine e)
        {
            e.Evaluate("f <- function(a) {if (length(a)!= 1) stop('What goes on?')}");
             var f = e.Evaluate("f").AsFunction();
             try
             {
            e.Evaluate("f(letters[1:3])");
             }
             catch (EvaluationException)
             {
             }
             f.Invoke(e.CreateCharacterVector(new[] { "blah" }));
             f.Invoke(e.CreateCharacterVector(new[] { "blah", "blah" }));

             // IEnumerable[] columns, string[] columnNames = null, string[] rowNames = null, bool checkRows = false, bool checkNames = true, bool stringsAsFactors = true);
             var columns = new[] {
            new[]{1,2,3,4,5},
            new[]{1,2,3,4,5},
            new[]{1,2,3,4,5}
             };
             var df = e.CreateDataFrame(columns, new[] { "a", "b", "c" });
             columns[1] = new[] { 1, 2, 3 };
             object blah;
             try
             {
            df = e.CreateDataFrame(columns, new[] { "a", "b", "c" });
            blah = df[1, 1];
             }
             catch
             {
             }
             df = e.CreateDataFrame(columns, new[] { "a", "b", "c" });
             blah = df[1, 1];
        }
開發者ID:jmp75,項目名稱:rdotnet-support,代碼行數:34,代碼來源:Program.cs


注:本文中的RDotNet.REngine.CreateDataFrame方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。