Quantcast
Channel: R.NET
Viewing all 1634 articles
Browse latest View live

Created Unassigned: I don't know Why r plot is broken. [176]

$
0
0
I want Displaying an R Graph within a C# .NET Winform.
So, I use RGraphHoot code form [here](https://rdotnet.codeplex.com/workitem/7).
But I have some problem.
Plot is broken when display with in panel.
I just call
cbt.install();
engine.Evaluate(@"....")
cbt.Uninstall();


Plz help~

Commented Unassigned: R.Net Error: could not find function "memory.limit" [175]

$
0
0
Hi, I have the following lines of code in C#:

string RpathOld = @"C:\Program Files\R\R-3.1.0\bin\x64";
string RpathNew = @"C:\Program Files\R\R-3.2.0\bin\x64";

try { REngine.SetEnvironmentVariables(RpathOld); }
catch { REngine.SetEnvironmentVariables(RpathNew); }

REngine engine = REngine.GetInstance();

But when it runs the last line I get an error:

An unhandled exception of type 'RDotNet.EvaluationException' occurred in RDotNet.dll

Additional information: Error: could not find function "memory.limit"

How can I solve this? I have tried to run the function "memory.limit()" in R and it works, giving me the RAM memory size.
Is there something I could to do to make R.Net work? Thanks.
Comments: This is a usually sign of a mismatch in R setting up its R_HOME environment variable. I would advise to set up both parameters ( r bin path and rHome path) in calling `SetEnvironmenbtVariables`. Unfortunately depending on whether one or more R versions are or were installed, and the state of the Windows registry, the automatic default path discovery is not always reliiable, hence the option to force specific paths). Hope this helps. As it happens I have managed to create a reproducible similar condition on one of my Windows machines while upgrading a version of R. I'll see what I can do to reduce or workaround these path issues. Hope this helps.

Commented Unassigned: Dataset Pass into R function C# [174]

$
0
0
Hi,

I want to pass dataset into r function in c# how its possible.

R Code :

```
fnData<-function(df)
{
ret<-df
#apply(df,1,mean)
return(df)
}
```
C# Code :

```
DataFrame df = engine.Evaluate("fnData('" + d + "')").AsDataFrame();
```
Comments: Assuming `d` is a .NET `System.Data.DataSet`, this cannot work. You need to create a DataFrame from C#; more than one way to do this. For reference to readers, the question appears related to http://stackoverflow.com/questions/30365878/how-to-pass-var-into-r-script, and includes a link to relevant sample code [DataFrameTest](https://github.com/jmp75/rdotnet/blob/master/RDotNet.Tests/DataFrameTest.cs)

Closed Unassigned: Dataset Pass into R function C# [174]

$
0
0
Hi,

I want to pass dataset into r function in c# how its possible.

R Code :

```
fnData<-function(df)
{
ret<-df
#apply(df,1,mean)
return(df)
}
```
C# Code :

```
DataFrame df = engine.Evaluate("fnData('" + d + "')").AsDataFrame();
```

Closed Unassigned: Rengine initialization: while running from visual studio first time i got the result on button click .But the second time while click on button, same hangs in engine.initialize....pls help meeeeeee........ [172]

$
0
0
Rengine initialization: while running from visual studio first time i got the result on button click .But the second time while click on button, same hangs in engine.initialize....pls help meeeeeee........

Please share the code
Comments: Cannot reproduce

Closed Unassigned: Getting error while browsing the rdotnet application from IIS [171]

$
0
0
Hi all,

'Please help me for the below issue. I have attached the error while browsing application from IIS. I am getting library tm not found. But the same is working from dotnetframework. I am facing the issue in IIS only.Pleasssssssssssssssseeeeeeeeee helpeeeeeeeeeeee meeeeeeeeeeeeeee....
Comments: The report is incomplete and not reproducible. Note that basic search on information already on codeplex or stackoverflow would have helped you, as the issue was previously reported and workaround provided

Closed Unassigned: rdotnet is very slow [170]

$
0
0
Please help me to avoid slowness in rdotnet

New Post: Plot display only half

$
0
0
I want Displaying an R Graph within a C# .NET Winform.
So, I use RGraphHoot code form here.
But I have some problem.
Plot is broken when display with in panel.
It display half of a plot.
I just call
cbt.install();
engine.Evaluate(@"....") cbt.Uninstall(); Plz help~

New Post: Precision of calculations

$
0
0
Could you tell me something about precision and reproducibility of calculations using R. Aren't there any problems using double data type?

Thanks a lot.

Updated Wiki: Home

$
0
0
Project Description: R.NET is an in-process interoperability bridge to R from the .NET Framework. R.NET requires .NET Framework 4 and the native R DLLs installed with the R environment. R.NET works on Windows, Linux and MacOS.

To get started you should now head for the R.NET documentation on GiHub pages. The documentation on this Codeplex site is now legacy.

R.NET is now distributed via R.NET.Community on NuGet

News

2015-08-09:
  • Moved the documentation to R.NET documentation on GiHub pages. Over the coming weeks it will have a growing list of howto and troubleshooting pages to facilitate user support, since many issues reported e.g. via stackoverflow are related.
  • Recently released R.NET 1.6.5.
  • Working on a new release of rClr rClr

2014-12-18 Release of the R package rClr 0.7-2 at rClr. This is a significant release due to the fact that all unit tests that can pass using Mono indeed pass.

2014-11-16 R.NET source code reference repository is now hosted on GitHub. This has been requested by several contributors amongst other things to facilitate pull requests.

2014-06-17 Thanks to Evelina Gabasova for documenting Setting up R.NET on Mac

Known Issues

  • There are persisting issues running R.NET from an ASP.NET application. Most issues can be worked around, but need clear documentation.

Whetting the appetite


Program.cs
using System;
using System.Linq;
using RDotNet;

namespace Sample1
{
   class Program
   {
      staticvoid Main(string[] args)
      {
         REngine.SetEnvironmentVariables();
         // There are several options to initialize the engine, but by default the following suffice:
         REngine engine = REngine.GetInstance();

         // .NET Framework array to R vector.
         NumericVector group1 = engine.CreateNumericVector(newdouble[] { 30.02, 29.99, 30.11, 29.97, 30.01, 29.99 });
         engine.SetSymbol("group1", group1);
         // Direct parsing from R script.
         NumericVector group2 = engine.Evaluate("group2 <- c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)").AsNumeric();

         // Test difference of mean and get the P-value.
         GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();
         double p = testResult["p.value"].AsNumeric().First();

         Console.WriteLine("Group1: [{0}]", string.Join(", ", group1));
         Console.WriteLine("Group2: [{0}]", string.Join(", ", group2));
         Console.WriteLine("P-value = {0:0.000}", p);

         // you should always dispose of the REngine properly.// After disposing of the engine, you cannot reinitialize nor reuse it
         engine.Dispose();

      }
   }
}

Related Projects

  • R to CLR: an R package to access .NET (CLR) objects from R, complementing R.NET. If you are looking to access .NET code from R interactively, you should consider this package.
  • F# R Provider: an F# library that provides static typed functions exposed by R packages, using the type provider mechanism of F#.

Reviewed: R.NET 1.5.19 (NuGet) (Aug 10, 2015)

$
0
0
Rated 5 Stars (out of 5) - Really appreciate the effort you guys are putting here - opening up R to .NET users like this is extremely helpful. Where can I donate?

New Post: p-value question

$
0
0
Hi,

I'd like to know how to access the p-value in a regression model.
The code below will print out regression statistics, including the p-value, but
how can I access the p-value in m?

> m <- lm(y ~ u + v + w)
> summary(m)

New Post: p-value question

$
0
0
After some googling I found out how you can access the p-values of the coefficients:

> summ <- summary(m)
> pvalues <- summ$coefficients[, 4]

New Post: Inside SQLCLR

$
0
0
Did anyone come up with anything on this front? I'm attempting to use R.Net in SQL CLR and I'm not getting very far. I don't have the .Net version issue but when I try to run the following code, my query in Sql Server just hangs....
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void HelloWorldFromR()
    {
        REngine.SetEnvironmentVariables();

        // There are several options to initialize the engine, but by default the following suffice:
        REngine engine = REngine.GetInstance();

        // Direct parsing from R script.
        GenericVector S = engine.Evaluate("S <- cat('Hello World!')").AsList();
        string s = S.AsCharacter().First().ToString();

        SqlContext.Pipe.Send(s);

        // you should always dispose of the REngine properly.
        // After disposing of the engine, you cannot reinitialize nor reuse it
        engine.Dispose();

    }

New Post: R.NET and Web application

$
0
0
I have an R script that can be run easily using the following code:

public DataFrame RunXCMS()
    {
        REngine.SetEnvironmentVariables();
        REngine engine = REngine.GetInstance();
        engine.Evaluate(@"source('script.R)");
        DataFrame testData = engine.Evaluate("read.csv('filepath)").AsDataFrame();
        return testData;

    }
However, when I call this function using a web app one of the modules that need to load with the script fails to load

Error: Unable to load 'mzR' which needs to be loaded with the XCMS package.

Why does it work when I launch it from Console App but not Web app?

Thanks!

New Post: Precision of calculations

$
0
0
Your question is way too broad to answer, and not even an R.NET specific topic.

The only thing I can say is that the numeric vectors in R use double precision. As for reproducibility, the issue (the lack thereof) has way, way more to do with humans than software.

New Post: Inside SQLCLR

$
0
0
You are sending either a null or an empty string to your Sql Pipe. Not sure whether this in intended, but just look at what R is doing even without R.NET with:
str(as.list(cat('Hello World!')))
str(as.list(s <- cat('Hello World!')))
str(s <- cat('Hello World!'))
as.character(s <- cat('Hello World!'))
If you call HelloWorldFromR several times, you should not call engine.Dispose more than once. As I recall, there should be an exception that state pretty clearly that the engine has been reinitialized/disposed more than once in the same process lifetime, something R cannot do.

Not enough information to figure out whether this explains why things "hang".

New Post: R.NET and Web application

New Post: R.NET and Web application

New Post: Precision of calculations

Viewing all 1634 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>