BSky.Statistics.R.RService.EvaluateToUAReturn C# (CSharp) Method

EvaluateToUAReturn() public method

public EvaluateToUAReturn ( string commandString ) : UAReturn
commandString string
return BSky.Statistics.Common.UAReturn
        public UAReturn EvaluateToUAReturn(string commandString)
        {
            UAReturn returnRecults = new UAReturn();
            returnRecults.CommandString = commandString;
            XmlDocument returnErrWarn;

            try
            {
                //16Apr2013///
                bool batchcommand = false;
                if (!batchcommand)
                    this._RServer.Evaluate("tmp<-" + commandString); // executing R Command with no left-hand var
                else
                    this._RServer.Evaluate(commandString);///16Apr2013 for commands like a<-somfun(..) and b = some expr. left hand var exists.
            }
            catch (Exception e)
            {
                string errm = "R.NET Error Msg not implemented";// this._RServer.GetErrorText();
                logService.WriteToLogLevel("Could not execute: < " + commandString + " >", LogLevelEnum.Error);
            }
            if (false)//this._RServer.GetErrorText() != RCommandReturn.Success)
            {
                returnErrWarn = null;

            }
            else if (!Conversions.ToBoolean(this._RServer.Evaluate("is.null(tmp)").AsLogical()[0]))
            {
                returnErrWarn = ParseToXmlDocument("tmp");
                ///here returnErrWarn will contain DOM. Having Error/Warn and Return results
            }
            else
            {
                returnErrWarn = null;
            }

            returnRecults.Data = returnErrWarn;
            returnRecults.SimpleTypeData = returnVal;// "Put results here. Should be used for RCommandStrings and nothing else.
            returnVal = null; // resetting so that old value does not get assigned to result of urrent command under execution.
            return returnRecults;
        }