using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using STATCONNECTORCLNTLib; using StatConnectorCommonLib; using STATCONNECTORSRVLib; namespace CSharp_R_test { class Program { static void Main(string[] args) { object O1; int n = 20; StatConnector Sc1 = new StatConnector(); Sc1.Init("R"); Sc1.SetSymbol("n1", n); Sc1.Evaluate("x1 <- n1"); O1 = Sc1.GetSymbol("x1"); Console.WriteLine(O1); } } }
如果库文件添加成功:
using STATCONNECTORCLNTLib; using StatConnectorCommonLib; using STATCONNECTORSRVLib;
就不会提示错误
原文:http://www.cnblogs.com/ChineseMoonGod/p/6369994.html