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

Commented Unassigned: Cannot call base package functionality in r [116]

$
0
0
Hi!

I have installed R.NET version 1.5.12, also tried version 1.5.11. I am simply trying to make the simple eample with the t-distribution test work.

Simple operations work fine, such as

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

But as soon as this row is executed:

GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();

There is a runtime error saying:

RDotNet.EvaluationException
{"Error: could not find function \"t.test\"\n"}

If I change the above call to

GenericVector testResult = engine.Evaluate("stats:::t.test(group1, group2)").AsList();

I get another that the stats.dll shared library cannot be loaded?!!

I currently have R for windows version 3.0.3 installed. Also tried with 3.1.0... Same result!

What is the issue here - am I doing something wrong? Quite unlikely since I just followed the example in the documentation.. ?

My machine is a brand new Win 7 64-bit.

Comments: What kind of project is this (Console, WinForms, WPF, ASP.Net, etc...)? I, and others, have encountered the same issue with hosting R as a WebAPI service under IIS. Attempts to work around the problem have been futile. It seems like it should be a simple permissions problem solvable by adding ISURS or a local account representing the AppPool to the R folder, but that did not fix it for me. My (hopefully temporary) workaround was to pull the R hosting into a WCF service that runs under my user account.

Commented Unassigned: Cannot call base package functionality in r [116]

$
0
0
Hi!

I have installed R.NET version 1.5.12, also tried version 1.5.11. I am simply trying to make the simple eample with the t-distribution test work.

Simple operations work fine, such as

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

But as soon as this row is executed:

GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();

There is a runtime error saying:

RDotNet.EvaluationException
{"Error: could not find function \"t.test\"\n"}

If I change the above call to

GenericVector testResult = engine.Evaluate("stats:::t.test(group1, group2)").AsList();

I get another that the stats.dll shared library cannot be loaded?!!

I currently have R for windows version 3.0.3 installed. Also tried with 3.1.0... Same result!

What is the issue here - am I doing something wrong? Quite unlikely since I just followed the example in the documentation.. ?

My machine is a brand new Win 7 64-bit.

Comments: Ok, I got a lock on my ASP.Net IIS issue. Posting as new issue for reference.

Created Unassigned: Hosting R under IIS generates an error when using functions from external R libraries [117]

$
0
0
If you create an ASP.Net project (MVC/WebAPI2), R will appear to load and function properly if you try executing simple code:
x <- 4 + 4
print(x)

will output 8.

However, if you try an external function such as the `summary` function located in stats.dll you get an error message.

print(summary((1:5))

*Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.1.0/library/stats/libs/i386/stats.dll': LoadLibrary failure: The specified module could not be found.*

Since the "stats.dll" is located in that folder, I assumed that the error was due to security permissions/configuration under IIS.

Typical troubleshooting steps do not resolve the issue:
- Make sure the asp.net application can run at "FullTrust" so it can load the unmananged assemblies.
- Ensure the the AppPool user account, or the IIS_IUSRS group has a minimum of read/load permissions on the R folder tree.
- Try running the AppPool as a local user account, instead of one of the synthetic IIS_IUSRS accounts.

While looking at the iisexpress process under `procmon`, I noticed that the "stats.dll" was being loaded properly, but the stats.dll was trying to load Rlapack.dll which is located in the R architecture bin folder. LoadLibrary will search the current folder (the stats.dll folder), and the search paths, but unless the R architecture bin folder is on the search path, the Rlapack.dll will not load, and R will return an error.

Adding the architecture bin folder to the path fixed the issue for stats. In my case, that was
C:\Program Files\R\R-3.1.0\bin\i386

I also believe that pulling the R binaries into the IIS virtual folder path will resolve the issue, but I have not verified it.

Another good test, is plotting from the DAAG library. This example would fail to load the lattice package before the path change:
library(DAAG)
#Good example. Dashed pen. Clipping. Cooks distance?
mf <- lm(log(timef)~log(time), data=nihills)
plot(mf, which=5)

but works properly now. See attachment.

Commented Unassigned: Hosting R under IIS generates an error when using functions from external R libraries [117]

$
0
0
If you create an ASP.Net project (MVC/WebAPI2), R will appear to load and function properly if you try executing simple code:
x <- 4 + 4
print(x)

will output 8.

However, if you try an external function such as the `summary` function located in stats.dll you get an error message.

print(summary((1:5))

*Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.1.0/library/stats/libs/i386/stats.dll': LoadLibrary failure: The specified module could not be found.*

Since the "stats.dll" is located in that folder, I assumed that the error was due to security permissions/configuration under IIS.

Typical troubleshooting steps do not resolve the issue:
- Make sure the asp.net application can run at "FullTrust" so it can load the unmananged assemblies.
- Ensure the the AppPool user account, or the IIS_IUSRS group has a minimum of read/load permissions on the R folder tree.
- Try running the AppPool as a local user account, instead of one of the synthetic IIS_IUSRS accounts.

While looking at the iisexpress process under `procmon`, I noticed that the "stats.dll" was being loaded properly, but the stats.dll was trying to load Rlapack.dll which is located in the R architecture bin folder. LoadLibrary will search the current folder (the stats.dll folder), and the search paths, but unless the R architecture bin folder is on the search path, the Rlapack.dll will not load, and R will return an error.

Adding the architecture bin folder to the path fixed the issue for stats. In my case, that was
C:\Program Files\R\R-3.1.0\bin\i386

I also believe that pulling the R binaries into the IIS virtual folder path will resolve the issue, but I have not verified it.

Another good test, is plotting from the DAAG library. This example would fail to load the lattice package before the path change:
library(DAAG)
#Good example. Dashed pen. Clipping. Cooks distance?
mf <- lm(log(timef)~log(time), data=nihills)
plot(mf, which=5)

but works properly now. See attachment.

Comments: Thanks for this. Issues running from ASP.NET are a recurring issue, that I cannot address, so your contributions are appreciated. If you wish and can make the time, could you fork and make a pull request of https://github.com/jmp75/rdotnet-onboarding ? there is a sample app there under tree/master/WebApplicationRdn . There is a sample script that used `lm` from the stats package, and it displayed symptoms identical to what you describe (see https://rdotnet.codeplex.com/discussions/462947). If you can contribute a fix to that sample application, this would be great material for tutorials. Thanks.

Commented Unassigned: Hosting R under IIS generates an error when using functions from external R libraries [117]

$
0
0
If you create an ASP.Net project (MVC/WebAPI2), R will appear to load and function properly if you try executing simple code:
x <- 4 + 4
print(x)

will output 8.

However, if you try an external function such as the `summary` function located in stats.dll you get an error message.

print(summary((1:5))

*Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.1.0/library/stats/libs/i386/stats.dll': LoadLibrary failure: The specified module could not be found.*

Since the "stats.dll" is located in that folder, I assumed that the error was due to security permissions/configuration under IIS.

Typical troubleshooting steps do not resolve the issue:
- Make sure the asp.net application can run at "FullTrust" so it can load the unmananged assemblies.
- Ensure the the AppPool user account, or the IIS_IUSRS group has a minimum of read/load permissions on the R folder tree.
- Try running the AppPool as a local user account, instead of one of the synthetic IIS_IUSRS accounts.

While looking at the iisexpress process under `procmon`, I noticed that the "stats.dll" was being loaded properly, but the stats.dll was trying to load Rlapack.dll which is located in the R architecture bin folder. LoadLibrary will search the current folder (the stats.dll folder), and the search paths, but unless the R architecture bin folder is on the search path, the Rlapack.dll will not load, and R will return an error.

Adding the architecture bin folder to the path fixed the issue for stats. In my case, that was
C:\Program Files\R\R-3.1.0\bin\i386

I also believe that pulling the R binaries into the IIS virtual folder path will resolve the issue, but I have not verified it.

Another good test, is plotting from the DAAG library. This example would fail to load the lattice package before the path change:
library(DAAG)
#Good example. Dashed pen. Clipping. Cooks distance?
mf <- lm(log(timef)~log(time), data=nihills)
plot(mf, which=5)

but works properly now. See attachment.

Comments: Absolutely. I have a couple of smaller PR's to submit also, including some a sample for the graphics device.

Commented Unassigned: Hosting R under IIS generates an error when using functions from external R libraries [117]

$
0
0
If you create an ASP.Net project (MVC/WebAPI2), R will appear to load and function properly if you try executing simple code:
x <- 4 + 4
print(x)

will output 8.

However, if you try an external function such as the `summary` function located in stats.dll you get an error message.

print(summary((1:5))

*Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.1.0/library/stats/libs/i386/stats.dll': LoadLibrary failure: The specified module could not be found.*

Since the "stats.dll" is located in that folder, I assumed that the error was due to security permissions/configuration under IIS.

Typical troubleshooting steps do not resolve the issue:
- Make sure the asp.net application can run at "FullTrust" so it can load the unmananged assemblies.
- Ensure the the AppPool user account, or the IIS_IUSRS group has a minimum of read/load permissions on the R folder tree.
- Try running the AppPool as a local user account, instead of one of the synthetic IIS_IUSRS accounts.

While looking at the iisexpress process under `procmon`, I noticed that the "stats.dll" was being loaded properly, but the stats.dll was trying to load Rlapack.dll which is located in the R architecture bin folder. LoadLibrary will search the current folder (the stats.dll folder), and the search paths, but unless the R architecture bin folder is on the search path, the Rlapack.dll will not load, and R will return an error.

Adding the architecture bin folder to the path fixed the issue for stats. In my case, that was
C:\Program Files\R\R-3.1.0\bin\i386

I also believe that pulling the R binaries into the IIS virtual folder path will resolve the issue, but I have not verified it.

Another good test, is plotting from the DAAG library. This example would fail to load the lattice package before the path change:
library(DAAG)
#Good example. Dashed pen. Clipping. Cooks distance?
mf <- lm(log(timef)~log(time), data=nihills)
plot(mf, which=5)

but works properly now. See attachment.

Comments: To add more context to the problem, NativeUtility.cs does append the R_HOME to the path, but what I _think_ the issue is caused by is that the IIS process already has a copy of the environment path at startup and the changes to the path are not reflected in that copy. The only way to get it to refresh is to stop and restart the process, but obviously the changes are only temporary, so they are lost on exit. Attached is output from procmon.

Source code checked in, #012fed162efd

$
0
0
Added tag 1.5.14 for changeset 72d052496ff3

Source code checked in, #57babf9194a6


New Post: STRONG NAME FOR RDotNet.dll

$
0
0
Hello,
I'm using RDotNet 1.5.5.
I want to upgrade my version for 1.5.11 for exemple.
But this dll have not strong name and my project need sign.
What do i do ?

Created Unassigned: XP library(lsmeans) don't work [118]

$
0
0
Hello,
I use R-2.15.2 with an addin Excel (framework 4 vs 2010) and Rdotnet 1.5.5
On 7 OS my application run very well but with XP i can't charge some library like "lsmeans".
My paths and installs are OK for both OS
Any suggestion ?

Commented Issue: R.Net 1.5.5 problem multithread and loaded machine. [115]

$
0
0
Hi,

Here is test project on problems reported in blogpost http://kostylizm.blogspot.ru/2014/05/run-r-code-from-c-sharp.html

Error messages we had in production:

Version 1.5.5:
Error: C stack usage is too close to the limit
In addition: Warning messages:
1: package 'xts' was built under R version 3.0.3
2: package 'rugarch' was built under R version 3.0.3
A first chance exception of type 'RDotNet.ParseException' occurred in RDotNet.dll

Version 1.5.11
at RDotNet.REngine.Parse(String statement, StringBuilder incompleteStatement)
at RDotNet.REngine.<Defer>c__Iterator4.MoveNext()
at System.Linq.Enumerable.LastOrDefault[TSource](IEnumerable`1 source)
at RDotNet.REngine.Evaluate(String statement)

In attached project reproduced only second.
Run method ParallelRFromRNetTest

Hope will help resolve problem.
Comments: Hi, Sorry for late response. Our project is WPF. We do many calulations and R.Net is just one of them thats why we have both parallel and lock. As I see you have found better test to reproduce it. I agree my test case was not good one, in production code it ws failing more often. I will leave not to myself to check next release. Thanks for your time.

New Post: Call RDotNet and R on 64-bit Mac OS X from 32-bit W7 over network

$
0
0
I am following the console example (https://rdotnet.codeplex.com/), which works fine on 32-bit Windows 7. However, the work that I have for R to do needs to load vectors bigger than 2 MB, which I can't do in 32-bit R. The R application (v.3.0.3) handles this just fine on Mac OS X 10.7.5 (64-bit). So I am attempting to call RDotNet and R from my VS console application on 32-bit W7 over a network connection to the Mac. Here are the code changes that I made:
REngine.SetEnvironmentVariables("\\\\MACBOOKPRO-443C\\Macintosh HD\\Library\\Frameworks\\R.framework\\Versions\\3.0\\Resources\\bin", "\\\\MACBOOKPRO-443C\\Macintosh HD\\Library\\Frameworks\\R.framework\\Versions\\3.0\\Resources\\bin");

Console.WriteLine(RDotNet.NativeLibrary.NativeUtility.FindRHome());
        
Console.WriteLine(RDotNet.NativeLibrary.NativeUtility.GetPlatform());

REngine engine = REngine.GetInstance("R");
``` I have also tried slightly changing the paths from /bin to /lib and calling Engine engine = REngine.GetInstance("libR.dylib"); . The console output is essentially the same:
c:\Program Files\R\R-3.0.3
Win32NT
Unhandled Exception:  System.Exception  This 32 bit process failed to load the library \MACBOOKPRO-443C\Macintosh HD\Library\\Frameworks\R.framework\Versions\3.0\Resources\bin\R (or libR.dylib)  Native error message is 'The system cannot find the file specified'
at RDotNet.NativeLibrary.UnmanagedDll.ReportLoadLibrary<String dllName>
at RDotNet.NativeLibrary.UnmanagedDll.ctor<String dllName>
at RDotNet.REngine.ctor<String id, String dllName>
at RDotNet.REngine.CreateInstance<String id, String dllName>
at RDotNet.REngine.GetInstance<String id, Boolean initialize, StartupParameter parameter, ICharacterDevice device>
at RConsoleAppTest.Program.Main<String[] args> in C:\Users\Me\Documnets\Visual Studio 2012\Projects\RConsoleAppTest\Program.cs: line 38
Line 38 is the REngine.GetInstance(). I had loaded the assemblies into my VS project through the network path, and they are in the same directories as R....
I see the problem that FindRHome and GetPlatform return W7 settings, from the registry, since that path no longer exists. Can anyone help to get FindRHome and GetPlatform to return the values from Mac, where I thought that I was actually running RDotNet and RDotNet.NativeLibrary? I think if I can resolve this, then there wouldn't be the 32-bit vs. 64-bit conflict that I'm getting, but I'm not sure. BTW, I built Mono in 64-bit mode on Mac OS X. Also, I'm using RDotNet 1.5.12.

Source code checked in, #c19da612e90e

Created Unassigned: Library Administrator problem [119]

$
0
0
Hi, I'm trying to install an R library from C# using R.net. When you try to install it from R console it shows a popup message asking your permission to install. The problem is when you try to do that from c#, this message never popup and can’t continue.

any idea? thanks !!!

New Post: Call RDotNet and R on 64-bit Mac OS X from 32-bit W7 over network

$
0
0
Unless I am missing something here, you are trying to execute Mac binary libraries on a Windows system; there is no way this could work as far as I know. The fact that the mac is 32 or 64 bits is not relevant; it is just a file server in this instance.

You'll need to access a Windows 64 bits, or use MonoDevelop on Mac or Linux to develop/debug your programs.

New Post: STRONG NAME FOR RDotNet.dll

$
0
0
Distributing R.NET with a strong name caused logistical difficulties for some users, for instance and importantly for https://github.com/BlueMountainCapital/FSharpRProvider. I don't plan to distribute R.NET with strong names.

You will need to compile/sign your own if your application really need to do so.

Commented Unassigned: Library Administrator problem [119]

$
0
0
Hi, I'm trying to install an R library from C# using R.net. When you try to install it from R console it shows a popup message asking your permission to install. The problem is when you try to do that from c#, this message never popup and can’t continue.

any idea? thanks !!!

Comments: This is probably where R asks the user confirmation whether to create c:/users/username/Documents/R-win-library-3.1.0 or some folder named like that (can't remember the format). Can you confirm whether this is the case? Not sure why the popup message is not displayed. R is used in a non-interactive mode (as it is embedded), so this might have this side effect. If this is the user's folder creation that is an issue, a workaround is to install one user's package from R console; the message should not have to pop up anymore then.

New Post: Call RDotNet and R on 64-bit Mac OS X from 32-bit W7 over network

$
0
0
Well, I am trying to issue a command from Windows to have them execute on Mac, then return an image back to Windows...

Created Issue: R.NET 1.5.14 breaks rClr data marshaling [120]

$
0
0
See (rClr issue 31)[https://rclr.codeplex.com/workitem/31]

Edited Issue: R.NET 1.5.14 breaks rClr data marshaling [120]

$
0
0
See [rClr issue 31](https://rclr.codeplex.com/workitem/31)
Viewing all 1634 articles
Browse latest View live




Latest Images