rdotnet: R.NET not working at all with R-3.5.0 pre-release

Hi, I found a strange issue. In my R dot Net application I am not able create R session when using R-3.5.0 pre-release version. It always worked with older versions of R (older than R-3.5.0). RStudio works with R-3.5.0 but not R dot Net. I am using R.NET 1.7.0. Older version R.NET 1.6.5 also failed for me.

I have attached a sample C#.NET project Line number 26 in Program.cs throws exception. Here is line 26 REngine engine = REngine.GetInstance();

RDotNetConsoleApp.zip

You can download R pre-release from following link: https://cran.r-project.org/bin/windows/base/rdevel.html

Please help.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 82 (31 by maintainers)

Commits related to this issue

Most upvoted comments

@jmp75 anything we can do to help finalize merging the R 3.5+ code into the master branch (sorry, know you’re busy)

I don’t think it has been fixed. I tried with a new installation of R 3.5 a few weeks ago and had the same problems, so reverted back to R 3.4.4

	This project has many sites and ways. This is very confusing to many of us who just want to use this great tool to be able to access R libraries from C#, that’s all. I suggest you, the developers please unify all these sites under one, and choose one kind of update path, and one progressing version. How about version 1.8, but not your version or his/her version on this site or that site. We are very grateful that you are doing incredible job to get this tool to work under current R libraries.  Let’s make its use simple and effective. Thank you all.
	
	

	Cem Girit

On Mon, Jan 28, 2019 at 10:25 PM -0500, “Luke R.” notifications@github.com wrote:

@Biopticon, @gusicadnan - what is your preferred way to access R.NET releases (code vs. NuGet)? I’ll be folding that branch into our master branch at a different repository. I don’t want to drive people there away from what @jmp75 has been maintaining, but unfortunately I don’t have rights on this repo or in NuGet to release. Am hoping @jmp75 may have a chance to chime in on incorporating the changes for R 3.5 here, or what the best path forward is to help maintain this project.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Does anyone have any idea of when this will be fixed in the Nuget version? (for all those involved, your efforts are massively appreciated!)

Hi, I tested version 1.8.2 and it works as expected. Thank you so much everyone for putting so much effort to make it work. Cheers

R.NET 1.8.1 is up on nuget, after a month of pre-release and some limited but positive feedback.

Short release notes is: Migration to .NET Standard 2.0, support for R 3.5.x, and moving to an MIT license. The license includes copyright attribution to the contributors.

There is a pre-release R.NET nuget package for user testing. Related and since @UnclAlDeveloper mentioned it rClr appears to be working really rather well on R 3.5, currently on a testing branch.

Unit tests are still a watchpoint at this stage (not always repeatable behavior), though perhaps not indicative of major problems for “real” use, hence the prerelease.

Shortly, thank you to people in this thread; will follow up with proper due credits for contributions.

@lrasmus - Good news! I can confirm that this issue now looks to be resolved in 32-bit. I ran this version on one of my more complex tools (lots of data being passed back and forth, simulations etc) with no problems.

The only remaining thing that I can see at the moment is the output / ICharacterDevice issue.

I think this is getting close 😃

EDIT: @lrasmus - You can ignore the previous email notification as I deleted my message. That was an error on my part.

I was able to get a build using the main repositories, but note when I did it it’s tied to .NET 4.5.1, not Core. Hopefully this will help @dannyparsons and @mortalrahu

git clone https://github.com/jmp75/rdotnet.git
git clone https://github.com/jmp75/dynamic-interop-dll.git
cd rdotnet
git checkout merge/StatTag
cd ..
cd dynamic-interop-dll
git checkout tags/0.8.1
  1. Create a new project in Visual Studio
  2. Right click on Solution, Add -> Existing Project
  3. Select dynamic-interop-dll/DynamicInterop/DynamicInterop.csproj
  4. Right click on Solution, Add -> Existing Project
  5. Select rdotnet/R.NET/RDotNet.csproj
  6. Right click on Solution, Add -> Existing Project
  7. Select rdotnet/RDotNet.NativeLibrary/RDotNet.NativeLibrary.csproj
  8. In your project, add References from the solution for DynamicInterop, RDotNet and RDotNet.NativeLibrary

NOTE: In the RDotNet and RDotNet.NativeLibrary projects, you may need to re-add the DynamicInterop reference, and may need to change .NET versions for the projects so they match.

@lrasmus I have used the test “RDotNet.S4ClassesTest.TestSlots” to tease out using the new Get_region methods. Seems to work out for integer and numeric vectors. Pushed to https://github.com/jmp75/rdotnet/tree/merge/StatTag . The new form of Vector.ToArray is a proposal. Feel free to suggest another.

Made some progress. I have a work in progress commit where I believe I’ve aligned the structs to the R 3.5 changes.

The challenge I’m working on now is with vector coercion. Per the release notes:

Coercing integer and numeric vectors to character also now uses the ALTREP framework to defer the actual conversion until first use.

I need to learn about the ALTREP framework now to understand how that works and how to get results out of my coerced vectors.

@jmp75 @the-tourist- @adpgithub - being optimistic that I’ll sort that out, what is the preferred way to integrate this back into R.NET? The project I’m using this in would ideally have a single R.NET included that figures out the right structs to use depending on the version of R running. Is this a breaking enough change that 2 versions of R.NET ( R<3.5, R>=3.5) is more manageable? Haven’t thought this through yet, so suggestions are welcome.

Oh no! Okay, I will admit that I was hoping this would kinda “fix itself” between pre-release and the official release, so I put it on the back burner. Let me revisit now and see if I can identify what’s going on, or at least some type of fix/workaround. Thanks @the-tourist- for reporting it’s still an issue!