public async Task <bool> InitialiseAsync() { //try //{ //logger.Log("Connecting to R...", Category.Info, Priority.None); var rHostSession = RHostSession.Create("TestApp"); //rHostSession.Connected += RHostSession_Connected; //rHostSession.Disconnected += RHostSession_Disconnected; rOperations = new ROperations(rHostSession); await rOperations.StartHostAsync(rHostSessionCallback); //await rOperations.ExecuteAsync("library(" + string.Format("\"{0}\"", "R.devices") + ")"); //await rOperations.ExecuteAsync("library(" + string.Format("\"{0}\"", "ggplot2") + ")"); await rOperations.ExecuteAndOutputAsync("setwd(" + ConvertPathToR(WindowsDirectory) + ")"); //logger.Log("Connected to R", Category.Info, Priority.None); //} //catch (Exception ex) //{ // //logger.Log("Failed to connect to R: " +ex.Message, Category.Exception, Priority.High); // return false; //} return(true); }
public RManager(IRHostSessionCallback rhostSession, ILoggerFacade loggerFacade, IROperations rOps) { //logger = loggerFacade; rHostSessionCallback = rhostSession; rOperations = rOps; }