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

Commented 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: please help for above issue

Commented 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: Please help for above issue

New Post: Python (and Other Dynamic Languages) Integration

$
0
0
I´m trying to use R.Net in IronPython. I´ve a C# application that has an IronPython script engine, in a way the user can write a script and run it. The idea is to provide R features to those scripts.

However, as I write the following example:
import clr
mport RDotNet
import RDotNet.Dynamic

R = RDotNet.Dynamic.RDynamic(Rengine)
As I run R.x=1, as you describe, I got the following error message.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'RDynamic' object has no attribute 'x'

As I try: print "Memory usage = ", float(R.memory.size()), the error message is:

Memory usage = Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: Operation is not valid due to the current state of the object.

What am I doing wrong?

Tks in advance,

Mauro

New Post: Python (and Other Dynamic Languages) Integration

$
0
0
It has been a while since I last worked on this, but I would be happy to help figure out what is going on.

Which version of IronPython, .Net and RDotNet are you using?

New Post: Python (and Other Dynamic Languages) Integration

New Post: Python (and Other Dynamic Languages) Integration

$
0
0
Mauro,

"Operation is not valid due to the current state of the object" tend to indicate that the native R engine has lost the plot; typically because of an engine reinitialisation (not possible because of R itself) or multi-threading.

sukru,

I was aware of your pull request; I was not allocating to reviewing at the time but would gladly have a look as there is a demand.

The code is now versioned on github; you can create a fork and submit a pull request if you wish. I am mindful that this may require more manual transfer of code than ideal; let me know if I can help to facilitate this.

Cheers

Commented Unassigned: rdotnet is very slow [170]

$
0
0
Please help me to avoid slowness in rdotnet
Comments: I think skyguy94 playfully hints, and rightly so, at [guidelines on how to ask a question or report an issue](http://stackoverflow.com/help/how-to-ask). R.NET has been optimized, so far as I know as much as is technically feasible. You may have a circumstance where things run slow, but unless you describe a reproducible problem, we cannot help you, as you request.

New Post: Python (and Other Dynamic Languages) Integration

$
0
0
Guys,

I was debugging Vector.cs and the error is in public abstract class Vector<T> : SymbolicExpression, IEnumerable<T> method, in the line:
base(engine, engine.GetFunction<Rf_allocVector>("Rf_allocVector")(type, length))
The GetFunction returns ok, the problem is in base call, I think it´s some trouble passing parameters type, length.

The second one, R.memory.size(), happens in SymbolicExpression GetSymbol(string name), name = 'memory'. It thows an exception because IsRunning is false.

I searched the source code, but I coundn´t find where it is set to true.

Well, this is all what I could find...

Tks,

Mauro

Created 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();
```

New Post: Python (and Other Dynamic Languages) Integration

$
0
0
Sorry, I was not feeling well for the last few days, and did not have a chance to look at this. I'll try to do so after work tonight.

New Post: Execute local R script

$
0
0
How to pass dataset or datatable to R script

Commented Unassigned: R.net Code not working [173]

$
0
0
Hi,

I get the from this site but not working, im new in R.Net please help me what is my mistake.

i am using MVC.

Code

```
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(new double[] { 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();
```

ERROR

```
Error: could not find function "t.test"
```



Give me the suggestion.


Thanks.
Comments: You have a very common problem with R running under IIS. If you add 'C:\Program Files\R\R-3.1.2\bin\i386' (or x64 if you are doing 64 bit) to your system path and restart Visual Studio or IIS then the stats package will load correctly. This is only for running under IIS and has to do with the DLL search paths under IIS while trying to find R's subordinate DLLs.

Commented Issue: ParseException on a call to dev.copy(png, ) [41]

$
0
0
See repro code in:
https://rdotnet.codeplex.com/discussions/446998

Work over Nov 2013 to Jan 2013 makes the diagnosis easier.
Comments: hi @jperraud i was trying to save an image from r.net, i have follow your instruction above, but it did not work for me below is my coding ``` engine.Evaluate("pospng <- ggplot(postdmdf, aes(x=term, y=freq)) + geom_bar(stat='identity', fill='#6cd054')+xlab('Terms') + ylab('Count') +coord_flip()"); engine.Evaluate("png('D:/somewhere/firsttry.png')"); engine.Evaluate("print(pospng)"); engine.Evaluate("dev.off()"); ``` at this line ``` engine.Evaluate("print(pospng)"); ``` it said pospng not found and i did try this way to save image ``` engine.Evaluate("setwd('D:/somewhere')"); engine.Evaluate("pospng <- ggplot(postdmdf, aes(x=term, y=freq)) + geom_bar(stat='identity', fill='#6cd054')+xlab('Terms') + ylab('Count') +coord_flip()"); engine.Evaluate("ggsave('somethingpos.png', width=8, height=4, dpi=100)"); ``` and get this error ``` Error in ggsave("somethingpos.png", width = 8, height = 4, dpi = 100) : plot should be a ggplot2 plot ```

New Post: how to call function from r script

$
0
0
First:
source("D:\something.R")
cannot work. You have a single backslash character. Use:
source(@"D:\something.R")
Probably the same thing with the following, as an aside:
"sentence = gsub('\\d+', '', sentence)" +
besides the whole string you build is not a valid function declaration: you have no semi-colon or newline separator between statements.
source(@"D:\something.R")
var sentiment = engine.GetSymbol("score.sentiment").AsFunction();
You'll find sample code on how to invoke functions for instance in https://github.com/jmp75/rdotnet/blob/master/RDotNet.Tests/RFunctionsTest.cs

New Post: how to use some functions of a R package by R.Net in an C# application?

$
0
0
Hello, Is it possible to call a function of R through some specific packages, such as 'rrcov'? I would be thankful if you refer me to some materials. Thanks in advance.

New Post: Interactive Graphics

Created 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.

New Post: How to release a standalone R.net exe

$
0
0
I want to build a release version of a program that runs an R script (from C# environment) which can run from a Windows PC without the need of also having the R library installed on the deployment PC.

If I build mt R.net code as release the created release folder holds, among others, the R.net libraries but misses the R libraries. I could manually copy the R.dll and maybe the rest of the stuff located in the bin/i386 folder into the release folder, and than have the R.net library (somehow) use that library. I am not sure how to go about this though.

I am also not sure if that is the right way of doing this. Could somebody give me an idea of how to create a standalone R.net program.

New Post: How to release a standalone R.net exe

$
0
0
In theory this is possible, in practice you should force the user to install R or write a script that does.

R is a C compiled program that is heavily platform dependent, and they jumped through all kinds of hopes to make that happen. The program compiles very differently on each platform, and you would have to distribute a binary that magically worked on each possible computer and architecture. Years of people trying has shown they are bad at this, so it's best to let R handle the installation of itself and all the libraries.

R is coded in C and requires an ungodly amount of effort to deploy on multiple machines. R.NET will work anywhere R and .NET can be installed, but it's best to leave the R and .NET installation process up to the people responsible for that.

Do not expect to be able to copy the .dll's and have those work. Those files are very platform specific.

New Post: How to release a standalone R.net exe

$
0
0
Thanks for the reply.

If I would do a static build, would that work?
Viewing all 1634 articles
Browse latest View live


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