Exemple #1
0
        public void Run()
        {
            // fire up R
            STATCONNECTORSRVLib.StatConnector statConn = new StatConnector();
            statConn.Init("R");

            // read the custom functions from the dir
            RFunctions rfunc = new RFunctions(_customFunctionsDir, statConn);

            rfunc.Reload();

            // for each set of assay results, associate the results with the substructure libraries
            foreach (AssayResults aResults in _hsAssayResults.Values)
            {
                // associate the stats collection with the results
                aResults.StatCollection = _stats.Copy();
                // associate the results with the substructure library
                _substructureLibrary.AddResults(aResults);
                // now, calculate the statistics for this result set (which will also calculate statistics for
                // all results sets that were added to the substructure library entries).
                aResults.CalculateStatistics(statConn);
            }
            // close the connection
            statConn.Close();
        }
        public void essai()
        {
            object        o1;
            int           n   = 20;
            StatConnector sc1 = new StatConnector();

            sc1.Init("R");
            sc1.SetSymbol("n1", n);
            sc1.Evaluate("x1<-rnorm(n1)");
            o1 = sc1.GetSymbol("x1");
            double Xrnd = (double)o1;

            MessageBox.Show(Xrnd.ToString());
        }
Exemple #3
0
        /// <summary>
        /// Implements IDisposable.Dispose()
        /// </summary>
        public void Dispose()
        {
            try
            {
                if (m_rServer != null)
                {
                    m_rServer.Close();
                }

                m_rServer = null;
            }
            catch (Exception exception)
            {
                throw new Exception("Exception in CRClient::Dispose().", exception);
            }
        }
Exemple #4
0
        /// <summary>
        /// init functionality
        /// </summary>
        /// <returns></returns>
        protected bool Init()
        {
            try
            {
                if (m_rServer == null)
                {
                    m_rServer = new StatConnector();
                    m_rServer.Init("R");
                    m_rServer.SetCharacterOutputDevice(this);
                }

                return(true);
            }
            catch (Exception exception)
            {
                throw new Exception("Exception in CRClient::Init().", exception);
            }
        }