r.net

Strange addTaskCallback work in RStudio

坚强是说给别人听的谎言 提交于 2020-01-25 04:44:30
问题 This is my next question from cycle of "strange" questions. I found same difference in code execution in R console and RStudio and couldn't understand reason of it. It's also connected with incorrect work of "track" package in RStudio and R.NET as I'd written before in Incorrect work of track package in R.NET So, let's look at example from https://search.r-project.org/library/base/html/taskCallback.html (I corrected it a little for correct data output for sum in RStudio) times <- function

Dataframe to datatable r.net fastly

ぃ、小莉子 提交于 2019-12-25 09:01:32
问题 I would like to know if there is a better method to convert a datanet from rnet to a datatable of system.data or something like that. Currently, what I'm doing is Dataframe dataset = engine.evaluate ("some dataframe"). AsDataframe (); DataTable dtable = new DataTable (); For (int i = 0; i <dataset.ColumnCount; ++ i) { Dtable.Columns.Add (dataset.ColumnNames [i]); } For (int k = 0; k <dataset.RowCount; ++ k) { Dtable.Rows.Add (dataset.GetRow (k) .DataFrame); } For (int i = 0; i <dataset

C# not connecting to R using RDotNet

廉价感情. 提交于 2019-12-23 02:34:08
问题 I am trying to interface C# to R using RDotNet . The following code is wants R to calculate the sum of two numbers and C# to get the result back and display it in the command window. using System; using RDotNet; namespace rcon { class Program { static void Main(string[] args) { string dllPath = @"C:\Program Files\R\R-3.1.0\bin\i386"; REngine.SetDllDirectory(dllPath); REngine.CreateInstance("RDotNet"); //REngine engine = REngine.GetInstanceFromID("RDotNet"); using (REngine engine = REngine

Retrieve result from R in C#

三世轮回 提交于 2019-12-14 02:56:26
问题 I used R.NET to perform Change Point Detection as following REngine.SetEnvironmentVariables(); REngine engine = REngine.GetInstance(); double[] data = new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; NumericVector vector = engine.CreateNumericVector(data); engine.Evaluate("library(changepoint)"); engine.SetSymbol("values", vector); engine.Evaluate("values.ts = ts(values, frequency = 12, start = c(2017, 1))"); engine.Evaluate("chpoints = cpt.mean(values.ts, method=\"BinSeg\")"); var

Can I use R.Net without installing R

时光毁灭记忆、已成空白 提交于 2019-12-12 13:44:25
问题 I am building an application within C# and I want to use some of the R libraries within this application. I am using R.Net to do this. However, I will deploy this software to users that may not have R downloaded on there computers. Is there any way that I can use the R dll so that the users can run my application without having to install R onto there machines? Many thanks 回答1: While this question is rather old, maybe this elaboration on Hackerman's answer will still help someone: You do not

Accessing R packages from asp.net

陌路散爱 提交于 2019-12-12 00:56:20
问题 I have an asp.net app where I am using R.NET. Everything works fine until I load a package using library() The web app of course runs in IIS and I get this error Error: package or namespace load failed for 'lattice'". Though it loads and works perfectly fine in Rstudio. Its some problem of R.NET not working with IIS. I have been searching around and it has been marked as a Known Issue on https://rdotnet.codeplex.com/. I was wondering if any one has found a workaround for this error. I went

Creating an instance of the REngine using R.Net version 1.5.5

放肆的年华 提交于 2019-12-10 16:08:49
问题 I am trying to create a "Hello World" example in R Language using R.Net version 1.5.5 (loaded from NuGet). Unfortunately, none of the online samples that I have seen work. THIS IS WHAT I HAVE DONE: Installed Microsoft R Open 3.2.4, the enhanced R distribution Installed R Tools for Visual Studio (R version 3.2.4 (2016-03-16)) Created an R Project & tested a simple script Created an MVC application & referenced R.Net version 1.5.5 from NuGet MY PROBLEM: All of the online examples I have seen

How to create an S4 Object using RdotNet

蓝咒 提交于 2019-12-08 12:28:56
问题 While using R.NET for creating an S4 object ( an output of a function from the mirt package. engine.Evaluate("library(mirt); data(LSAT6); x=mirt(LSAT6,1)"); S4Object Convertedinput = inputtoCsharp.AsS4(); I need to to see the output of x (all the slots of x) into a message box. How can I do that? because there is no method which does something like this: int[] resp_c = new int [] {1,1,1,1}; **IntegerVector resp_cR = engine.CreateIntegerVector(resp_c);** engine.SetSymbol("resp_c", resp_cR);

C# not connecting to R using RDotNet

只愿长相守 提交于 2019-12-08 12:14:25
I am trying to interface C# to R using RDotNet . The following code is wants R to calculate the sum of two numbers and C# to get the result back and display it in the command window. using System; using RDotNet; namespace rcon { class Program { static void Main(string[] args) { string dllPath = @"C:\Program Files\R\R-3.1.0\bin\i386"; REngine.SetDllDirectory(dllPath); REngine.CreateInstance("RDotNet"); //REngine engine = REngine.GetInstanceFromID("RDotNet"); using (REngine engine = REngine.GetInstanceFromID("RDotNet")) { var x = engine.Evaluate("x <- 1 + 2"); Console.WriteLine(x); } } } } but

How to get ExcelDNA work with R.Net

陌路散爱 提交于 2019-12-07 22:59:54
问题 I am a C# and R beginner trying to run the example http://mockquant.blogspot.com/2011/07/yet-another-way-to-use-r-in-excel-for.html <DnaLibrary RuntimeVersion="v4.0" Name="My First XLL" Language="CS"> <ExternalLibrary Path="R.NET.dll" /> <Reference Name="R.NET" /> <![CDATA[using System; using System.Collections.Generic; using System.Linq; using System.Text; using ExcelDna.Integration; using RDotNet; namespace CSLib { public class CSLib { static REngine rengine = null; static CSLib() { // Set