I am calling R functions in C# using R.NET. While doing that I realized that every time I call a function I need to specif its type.
For Instance:
engine.Evaluate("x = 3.5:10.5");
NumericVector a1= engine.GetSymbol("x").AsNumeric();
For above code I need to specify that a1 is a numeric vector.
engine.Evaluate("x = c('a',3,7,'adad', 'xyz')");
CharacterVector a2 = engine.GetSymbol("x").AsCharacter();
For this code I needed to specify that a2 is a character vector.
Is there any way to get to know the type of the data? or use something general which is applicable to all data types/objects?
Any help is appreciated. Thanking you in advance.