gpt4 book ai didi

r.net RDotNet.REngine 不包含 'GetInstance' 的定义

转载 作者:行者123 更新时间:2023-12-04 02:15:57 24 4
gpt4 key购买 nike

我直接从文档中复制代码 http://jmp75.github.io/rdotnet/tut_basic_types/

REngine.SetEnvironmentVariable() 和 REngine.GetInstance() 都会给出编译器错误,提示“RDotNet.REngine”不包含定义。

我安装了 nuget 包 R.Net 版本 1.5.5,我正在运行一个 c# 控制台应用程序。

using System;
using System.Linq;
using RDotNet;

namespace Sample1
{
class Program
{
static void Main(string[] args)
{
REngine.SetEnvironmentVariables(); // <-- May be omitted; the next line would call it.
REngine engine = REngine.GetInstance();
// A somewhat contrived but customary Hello World:
CharacterVector charVec = engine.CreateCharacterVector(new[] { "Hello, R world!, .NET speaking" });
engine.SetSymbol("greetings", charVec);
engine.Evaluate("str(greetings)"); // print out in the console
string[] a = engine.Evaluate("'Hi there .NET, from the R engine'").AsCharacter().ToArray();
Console.WriteLine("R answered: '{0}'", a[0]);
Console.WriteLine("Press any key to exit the program");
Console.ReadKey();
engine.Dispose();

}
}
}

我用谷歌搜索,找不到答案。有什么想法吗?

最佳答案

有两个来自不同发布者的 R.Net nuget 包。我安装错了。糟糕。

此示例的正确包是 R.NET.Community .

关于r.net RDotNet.REngine 不包含 'GetInstance' 的定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33618330/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com