當前位置: 首頁>>代碼示例>>C#>>正文


C# REngine.Initialize方法代碼示例

本文整理匯總了C#中RDotNet.REngine.Initialize方法的典型用法代碼示例。如果您正苦於以下問題:C# REngine.Initialize方法的具體用法?C# REngine.Initialize怎麽用?C# REngine.Initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RDotNet.REngine的用法示例。


在下文中一共展示了REngine.Initialize方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: frmData

 public frmData()
 {
     InitializeComponent();
     // There are several options to initialize thengine, but by default the following suffice:
     engine = REngine.GetInstance();
     engine.Initialize();
 }
開發者ID:jld12345,項目名稱:BiologyDataProject,代碼行數:7,代碼來源:frmData.cs

示例2: CodeController

        public CodeController()
        {
            if (_engine != null) return;

            _engine = REngine.GetInstance(null, true, null, CharacterDevice);
            _engine.Initialize();
            _engine. .Install(GraphicsDevice);
        }
開發者ID:grldsndrs,項目名稱:rdotnet-onboarding,代碼行數:8,代碼來源:CodeController.cs

示例3: Form1

        public Form1()
        {
            InitializeComponent();
            this.FormClosed += new FormClosedEventHandler(OnFormClosed);

            REngine.SetEnvironmentVariables();
            engine = REngine.GetInstance();
            // REngine requires explicit initialization.
            // You can set some parameters.
            engine.Initialize();
        }
開發者ID:savannaking,項目名稱:Practice,代碼行數:11,代碼來源:Form1.cs

示例4: InitializeRDotNet

 internal static void InitializeRDotNet()
 {
     try
     {
         REngine.SetEnvironmentVariables();
         _engine = REngine.GetInstance();
         _engine.Initialize();
     }
     catch (Exception ex)
     {
         LogDisplay.WriteLine("Error initializing RDotNet: " + ex.Message);
     }
 }
開發者ID:stic,項目名稱:Excel-DNA-Samples,代碼行數:13,代碼來源:AddIn.cs

示例5: GetInstance

 /// <summary>
 /// Gets a reference to the R engine, creating and initializing it if necessary. In most cases users need not provide any parameter to this method.
 /// </summary>
 /// <param name="dll">The file name of the library to load, e.g. "R.dll" for Windows. You usually do not need need to provide this optional parameter</param>
 /// <param name="initialize">Initialize the R engine after its creation. Default is true</param>
 /// <param name="parameter">If 'initialize' is 'true', you can optionally specify the specific startup parameters for the R native engine</param>
 /// <param name="device">If 'initialize' is 'true', you can optionally specify a character device for the R engine to use</param>
 /// <returns>The engine.</returns>
 /// <example>
 /// <p>A minimalist approach is to just call GetInstance</p>
 /// <code>
 /// REngine.SetEnvironmentVariables();
 /// var engine = REngine.GetInstance();
 /// engine.Evaluate("letters[1:26]");
 /// </code>
 /// <p>In unusual circumstances you may need to elaborate on the initialization in a separate method call</p>
 /// <code>
 /// REngine.SetEnvironmentVariables([email protected]"c:\my\peculiar\path\to\R\bin\x64");
 /// var engine = REngine.GetInstance(initialize=false);
 /// StartupParameter sParams=new StartupParameter(){NoRenviron=true;};
 /// ICharacterDevice device = new YourCustomDevice();
 /// engine.Initialize(parameter: sParams, device: device);
 /// engine.Evaluate("letters[1:26]");
 /// </code>
 /// </example>
 public static REngine GetInstance(string dll = null, bool initialize = true, StartupParameter parameter = null, ICharacterDevice device = null)
 {
     if (!environmentIsSet) // should there be a warning? and how?
         SetEnvironmentVariables();
     if (engine == null)
     {
         engine = CreateInstance(EngineName, dll);
         if (initialize)
             engine.Initialize(parameter, device);
     }
     if (engine.Disposed)
         throw new InvalidOperationException("The single REngine instance has already been disposed of (i.e. shut down). Multiple engine restart is not possible.");
     return engine;
 }
開發者ID:mgtstrategies,項目名稱:rdotnet,代碼行數:39,代碼來源:REngine.cs

示例6: InitializeRDotNet

 private void InitializeRDotNet()
 {
     REngine.SetEnvironmentVariables();
     engine = REngine.GetInstance();
     // REngine requires explicit initialization.
     // You can set some parameters.
     engine.Initialize();
     //load BSky and R packages
     engine.Evaluate("library(uadatapackage)");
     engine.Evaluate("library(foreign)");
     engine.Evaluate("library(data.table)");
     engine.Evaluate("library(RODBC)");
     engine.Evaluate("library(car)");
     engine.Evaluate("library(aplpack)");
     engine.Evaluate("library(mgcv)");
     engine.Evaluate("library(rgl)");
     engine.Evaluate("library(gmodels)");
 }
開發者ID:BlueSkyStatistics,項目名稱:BlueSkyRepository,代碼行數:18,代碼來源:SyntaxEditorWindow.xaml.cs

示例7: InitiateR

        private static void InitiateR()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            form1 = new Form1();
            string rhome = System.Environment.GetEnvironmentVariable("R_HOME");
            if (string.IsNullOrEmpty(rhome))
                rhome = @"C:\Program Files\R\R-3.1.1";

            System.Environment.SetEnvironmentVariable("R_HOME", rhome);
            System.Environment.SetEnvironmentVariable("PATH", System.Environment.GetEnvironmentVariable("PATH") + ";" + rhome + @"\bin\i386");

            REngine.SetEnvironmentVariables();
            // There are several options to initialize the engine, but by default the following suffice:
            engine = REngine.GetInstance();
            engine.Initialize();
        }
開發者ID:blankon123,項目名稱:rdotnet-parsing,代碼行數:17,代碼來源:Program.cs

示例8: MakeEngine

 private static void MakeEngine()
 {
     if (_engine == null)
     {
         REngine.SetEnvironmentVariables();
         _engine = REngine.GetInstance();
         _engine.Initialize();
     }
 }
開發者ID:benamenco,項目名稱:InfernoRDN,代碼行數:9,代碼來源:RdnConnector.cs

示例9: TextMiningApi

 public TextMiningApi()
 {
     REngine.SetEnvironmentVariables();
     _engine = REngine.GetInstance();
     _engine.Initialize();
 }
開發者ID:krasnovandr,項目名稱:Personal,代碼行數:6,代碼來源:TextMiningApi.cs

示例10: InitializeR

        private void InitializeR()
        {
            engine = REngine.GetInstance();
            engine.Initialize();
            var currentDir = System.Environment.CurrentDirectory.Replace('\\', '/');
            if (!m_JADE_Loaded)
            {
               
                engine.Evaluate("install.packages('JADE', repos='http://cran.us.r-project.org')");

                //repos ='https://cran.rstudio.com/bin/windows/contrib/3.2/JADE_1.9-93.zip')");

                engine.Evaluate("library('JADE')");
                m_JADE_Loaded = true;
            }
            
        }
開發者ID:Astolfoho,項目名稱:Kinectv2HeartRate,代碼行數:17,代碼來源:MainWindow.xaml.cs


注:本文中的RDotNet.REngine.Initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。