Here is my current code:
private string result;
private string result1;
public async Task calCasync(string ar)
{
REngine engine;
REngine.SetEnvironmentVariables();
engine = REngine.GetInstance();
engine.Initialize();
CharacterVector vector = engine.Evaluate(ar).AsCharacter();
result = vector[0];
ReplyAsync("> " + result);
try
{
result1 = String.Join(" ", vector.Cast<int>());
ReplyAsync("> ");
ReplyAsync("ad> " + result1);
}
catch(Exception e)
{
Console.WriteLine(e);
}
}`
I have tried to modify some parts of it to make it work, but it only responds with 'result' and not 'result1'. In this I would like to convert a matrix or a vector into a string which I can use for further things.
result = vector[1];
or higher gives a error saying that it is too high. Every time executed result1 = String.Join(" ", vector.Cast<int>()); gives a error. I have not found any information online on this topic. If it does help I am using visual studio 2017.
Thanks -Yan
Here is my Code.
Open the R Editor and type the below code:
Type characters in R console window Then
Output : "H" "E" "L" "L" "O"
Type stringdata in R console window Then
Output : "HELLO"
for paste function in R refer the below documentation
https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/paste