When iterating a linear model as a data frame, some of the columns (e.g. "call") are of Type SystemExpressionType.LanguageObject. DynamicVector throws a NotImplementedException in DataSize, this[int index], etc. for types other than NumericVector, IntegerVector, CharacterVector, LogicalVector, RawVector and ComplexVector, so how is one expected to generically iterate across other valid values in a data frame? (An obvious workaround is to access columns by name here, skipping "call" columns).
To reproduce:
SymbolicExpression result = engine.EagerEvaluate("summary(model)");
DataFrame dataFrame = result.AsDataFrame();
Console.WriteLine(dataFrame.RowCount);
Console.WriteLine(dataFrame.ColumnCount);
for (int i = 0; i < dataFrame.RowCount; ++i)
{
for (int j = 0; j < dataFrame.ColumnCount; ++j)
{
DataFrameRow row = dataFrame.GetRow(i);
object column = row[j]; // NotImplementedException will occur here from DynamicVector.DataSize
Console.Write(dataFrame.ColumnNames[j]);
Console.Write(" = ");
Console.Write(column);
Console.Write(", ");
}
Console.WriteLine();
}
To reproduce:
SymbolicExpression result = engine.EagerEvaluate("summary(model)");
DataFrame dataFrame = result.AsDataFrame();
Console.WriteLine(dataFrame.RowCount);
Console.WriteLine(dataFrame.ColumnCount);
for (int i = 0; i < dataFrame.RowCount; ++i)
{
for (int j = 0; j < dataFrame.ColumnCount; ++j)
{
DataFrameRow row = dataFrame.GetRow(i);
object column = row[j]; // NotImplementedException will occur here from DynamicVector.DataSize
Console.Write(dataFrame.ColumnNames[j]);
Console.Write(" = ");
Console.Write(column);
Console.Write(", ");
}
Console.WriteLine();
}