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

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

$
0
0
See [rClr issue 31](https://rclr.codeplex.com/workitem/31)
Comments: Fixed with R.NET 1.5.15

Source code checked in, #1212c26806be

$
0
0
Fix https://rdotnet.codeplex.com/workitem/120

Source code checked in, #54dc625cc190

$
0
0
Added tag 1.5.15 for changeset 1212c26806be

Released: R.NET 1.5.15 (May 30, 2014)

$
0
0
R.NET 1.5.15 is a beta release towards R.NET 1.6. You are encouraged to use it now and give feedback.

This update is only available via nuget.org at R.NET Community and R.NET FSharp Utility. You are strongly encouraged to use nuget to manage the dependency of your work on R.NET.

See the documentation for setup and usage instructions.

Main changes:
A change was introduced in 1.5.14, to prevent garbage collections of transient objects, in the libraryDeedle that depends on R.NET. While it may not have introduced many issues, it did break some things in the latest unreleasedrClr package.

Created Release: R.NET 1.5.15 (May 30, 2014)

$
0
0
R.NET 1.5.15 is a beta release towards R.NET 1.6. You are encouraged to use it now and give feedback.

This update is only available via nuget.org at R.NET Community and R.NET FSharp Utility. You are strongly encouraged to use nuget to manage the dependency of your work on R.NET.

See the documentation for setup and usage instructions.

Main changes:
A change was introduced in 1.5.14, to prevent garbage collections of transient objects, in the library Deedle that depends on R.NET. While it may not have introduced many issues, it did break some things in the latest unreleased rClr package.

New Post: STRONG NAME FOR RDotNet.dll

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: I've been struggling with the R.NET webapp issue 8 hours, and I just found this forum. Please can you elaborate a little more on the solution... I've tried ``` var dllDirectory = @"C:\Program Files\R\R-3.1.0\bin\i386\"; Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";" + dllDirectory); Debug.WriteLine("PATH=" + System.Environment.GetEnvironmentVariable("PATH")); ``` But I check procmon and it does not make a different. 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: You don't set it from RDotNet, you set it for the system environment from the windows control panel. The key is to set it before the process is started.

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: Finally, Thank you so much...I spend so many hours... I included C:\Program Files\R\R-3.1.0\bin\i386 in %PATH%, restart the computer an just works Bests, Carlos

Commented Issue: build.fsx fails if used with with framework 4.0 msbuild.exe [87]

$
0
0
Logging a repro here for a bug report to microsoft and/or the open source version of f#.

Check out after [this changeset](https://rdotnet.codeplex.com/SourceControl/changeset/f8e3bd4164f0)

RDotNet.Release.sln solution builds, or cleans when done from VS2013, but not using msbuild version coming with the .NET framework

* Microsoft Visual Studio Professional 2013
* Version 12.0.30110.00 Update 1
* Microsoft .NET Framework
* Version 4.5.50938
* Visual F# 2013 <snip>
* Microsoft Visual F# 2013

```
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe F:\codeplex\rdotnet\RDotNet.FSharp\RDotNet.FSharp.fsproj /t:Clean /m /p:Configuration="Release"
```

leads to:
```
F:\codeplex\rdotnet\RDotNet.FSharp\RDotNet.FSharp.fsproj : error MSB4057: The target "Clean" does not exist in the project.
```

whereas, replicating what VS2013 does under the hood, the following works:
```
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" F:\codeplex\rdotnet\RDotNet.Release.sln /t:Rebuild /m /p:Configuration="Release"
```

Comments: The fsproj file is VS 2013-style. If you build with MSBuild 12.0, $VisualStudioVersion gets set to 12.0 and you pick up required targets file from VS 2013 drop location. If you build with older MSBuild I believe you will get VisualStudioVersion of 11.0 (might be wrong there) in which case it will try to load targets from VS 2012 location. Do you have VS 2012 installed, as well? If not, then my initial guess is that the targets file can't be found, and you don't get various targets like 'Clean'. Relevant logic in the project: ``` XML <Choose> <When Condition="'$(VisualStudioVersion)' == '11.0'"> <PropertyGroup> <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> </PropertyGroup> </When> <Otherwise> <PropertyGroup> <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> </PropertyGroup> </Otherwise> </Choose> ``` Workaround: If you prefer to use older MSBuild, you can try setting VisualStudioVersion explicitly in the command line - `/p:VisualStudioVersion=12.0`

Released: R.NET 1.5.15 (NuGet) (May 30, 2014)

$
0
0
R.NET 1.5.15 is a beta release towards R.NET 1.6. You are encouraged to use it now and give feedback.

This update is only available via nuget.org at R.NET Community and R.NET FSharp Utility. You are strongly encouraged to use nuget to manage the dependency of your work on R.NET.

See the documentation for setup and usage instructions.

Main changes:
A change was introduced in 1.5.14, to prevent garbage collections of transient objects, in the libraryDeedle that depends on R.NET. While it may not have introduced many issues, it did break some things in the latest unreleasedrClr package.

Updated Release: R.NET 1.5.15 (NuGet) (May 30, 2014)

$
0
0
R.NET 1.5.15 is a beta release towards R.NET 1.6. You are encouraged to use it now and give feedback.

This update is only available via nuget.org at R.NET Community and R.NET FSharp Utility. You are strongly encouraged to use nuget to manage the dependency of your work on R.NET.

See the documentation for setup and usage instructions.

Main changes:
A change was introduced in 1.5.14, to prevent garbage collections of transient objects, in the library Deedle that depends on R.NET. While it may not have introduced many issues, it did break some things in the latest unreleased rClr package.

Created Unassigned: Review behavior of REngine.Initialize [121]

$
0
0
I think I need to keep the Initialize API in some use cases, in addition to GetInstance. Do I really? the inconvenient is that it currently silently ignores calls more than once. This may create issues for users unaware (or who do not see the XML docco from the IDE).

Reconsider, in light of https://github.com/BlueMountainCapital/FSharpRProvider/pull/107


Edited Task: Review behavior of REngine.Initialize [121]

$
0
0
I think I need to keep the Initialize API in some use cases, in addition to GetInstance. Do I really? the inconvenient is that it currently silently ignores calls more than once. This may create issues for users unaware (or who do not see the XML docco from the IDE).

Reconsider, in light of https://github.com/BlueMountainCapital/FSharpRProvider/pull/107


New Post: How to fetch R output to C# forms ?

$
0
0
Hi,


I am new to R programming.

I am stuck while building application. I created a R script that fetches BARPLOT. but how to get that output on a C# form.


Please help me.

Thanks in advance.

Avinash

New Post: DLL was not found

$
0
0
Hi All,

I am running the following code and I receive the error message below. Any idea what is the trouble? On the PC it is installed .NET Framework of a version higher than 4.

Thank you
Dragomir

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RDotNet;

namespace ConsoleApplication2
{
class Program
{
    static void Main(string[] args)
    {
        var envPath = Environment.GetEnvironmentVariable("PATH");
        var rBinPath = @" C:\Program Files\R\R-3.1.0\bin\i386";
        Environment.SetEnvironmentVariable("PATH", envPath + System.IO.Path.PathSeparator + rBinPath);
        using (REngine engine = REngine.CreateInstance("RDotNet"))
        {

            engine.Initialize();


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



'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\LocalAdmin\Documents\Visual Studio 2012\Projects\ConsoleApplication13\ConsoleApplication13\bin\Debug\ConsoleApplication13.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'vshost.NotifyLoad' (0x172c) has exited with code 0 (0x0).
The thread '<No Name>' (0x16f4) has exited with code 0 (0x0).
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'vshost.NotifyLoad' (0x44c) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x3b4) has exited with code 0 (0x0).
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\LocalAdmin\Documents\Visual Studio 2012\Projects\ConsoleApplication13\ConsoleApplication13\bin\Debug\ConsoleApplication13.exe', Symbols loaded.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\LocalAdmin\Documents\Visual Studio 2012\Projects\ConsoleApplication13\ConsoleApplication13\bin\Debug\RDotNet.dll'
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\LocalAdmin\Documents\Visual Studio 2012\Projects\ConsoleApplication13\ConsoleApplication13\bin\Debug\RDotNet.NativeLibrary.dll'
A first chance exception of type 'System.DllNotFoundException' occurred in RDotNet.NativeLibrary.dll
An unhandled exception of type 'System.DllNotFoundException' occurred in RDotNet.NativeLibrary.dll
Additional information: Dll was not found.
'ConsoleApplication13.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[4996] ConsoleApplication13.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

New Post: DLL was not found

$
0
0
You seem to be using on older version of R.NET.

I'd advise you follow https://rdotnet.codeplex.com/documentation for your tests, using the latest packages on NuGet. It is not possible to say what is going on from the error reported. above. Newer versions of R.NET have better error messages.

New Post: DLL was not found

$
0
0
jperraud, you are right: I have to call the latest version of R.NET as described in the Documentation site. Thank you

New Post: R.Net data type and C#

$
0
0
Hi All,

If I run

var e = engine.Evaluate("x <- 3")

or

NumericVector x = engine.GetSymbol("x").AsNumeric();

I can't use neither e nor x for further calculations in C#, for example

var y = e + 4* x

What can/shall be done to have R.Net output usable for C# calculations. Thank you.

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: thanks, I fix it intalling r.net from Visual studio (extensions and updates). maeby I had and old dll.
Viewing all 1634 articles
Browse latest View live


Latest Images

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