Netlogo 6.1 with R 3.6.0?

101 views
Skip to first unread message

Laszlo Gulyas

unread,
Jul 22, 2019, 5:13:30 PM7/22/19
to netlogo-users
Dear All,

Did anyone have success with running the R-extension with Netlogo 6.1?

I have used this extension successfully with earlier versions (of both R and Netlogo) in the past. This time, I am following the steps described here (Section 'Installing', https://ccl.northwestern.edu/netlogo/docs/r.html), but I keep getting Error #02: Cannot find rJava/JRI. The R Extension was unable to locate your installation of rJava. Some steps to resolve. My version of rJava is 0.9-11.

Any tips for further debugging will also be appreciated.

Best regards,

-- Laszlo (a.k.a. Gulya)

Harrykipper

unread,
Jul 23, 2019, 7:27:43 AM7/23/19
to netlog...@googlegroups.com
Hi Laszlo,

the dev team changed the location of the bundled extensions in the last
version of Netlogo and that introduced a small bug.
If you move the r directory from app/extensions/.bundled to
app/extensions it works again. You also need to edit the r.home and
jri.home.paths directives in the user.properties file in the
r directory as advised here: https://github.com/NetLogo/R-Extension



Laszlo Gulyas

unread,
Jul 23, 2019, 1:23:45 PM7/23/19
to netlogo-users
Hi,

Thanks for the suggestion. I have moved the r-extension from .bundled to one directory up in the hierarchy, but nothing changes.
Do you have any further hints on how to check what is actually going wrong? The error message says it cannot locate rJava/JRI, but it would be nice to know which of those fails.

Best,
Laszlo

Laszlo Gulyas

unread,
Jul 23, 2019, 2:09:20 PM7/23/19
to netlogo-users
Hi,

Actually, I got past the previous point. 

NetLogo now crashes upon interpreting the line 'extensions [r]'. 

Anyone has any idea on how to get past this point? I remember that when I set up the R-bridge with earlier versions I had a similar issue, which turned out to be something banal, like a typo somewhere in the configuration. Then the way to catch the bug was to run netlogo from the command prompt and thus get to read the actual underlying exception. This time nothing is printed in the command line. 

Best regards,

-- Laszlo

Charles Staelin

unread,
Jul 23, 2019, 8:45:03 PM7/23/19
to netlogo-users
Laszlo,

After much fiddling and looking at the source files, I tried moving just the user.properties file up one directory and leaving the rest of the extension under .bundled\r.  So the user.properties file is in a new app\extensions\r directory.  The user.properties file in my configuration has the following lines::

r.home=C:/Program Files/R/R-3.6.1/bin/x64
jri.home.paths=C:/Users/cstaelin/Documents/R/win-library/3.6/rJava/jri
r.lib.paths=C:/Users/cstaelin/Documents/R/win-library/3.6

It appears that only the path the the user.properties file is incorrect in the latest version.  Hope this works for you.

Charles

Baki Ünal

unread,
Jul 24, 2019, 3:02:42 PM7/24/19
to netlog...@googlegroups.com
Hi

I followed Charles' instructions. I created C:\Program Files\NetLogo 6.1.0\app\extensions\r directory. And I moved user.properties file to this directory and set the paths. However when I write extensions [ r ] to code tab I get the following error:

Error initializing R extension. (Error #04) java.lang.reflect.InvocationTargetException java.lang.ExceptionInInitializerError

My user.properties file is:

r.home=C:/Program Files/R/R-3.5.3/bin/x64
jri.home.paths=C:/Users/win10/Documents/R/win-library/3.5/rJava/jri
r.lib.paths=C:/Users/win10/Documents/R/win-library/3.5

How can I fix this problem?
Best Regards

Baki Ünal

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/ea09b04a-3817-430b-87c3-baed68b90cf8%40googlegroups.com.

Jeremy Baker

unread,
Jul 24, 2019, 5:10:52 PM7/24/19
to netlogo-users
Hey everyone.

There was a bug, as pointed out by Harry and verified by others, in the version of the R extension that shipped with NetLogo 6.1.0.  I believe we have this corrected, but as part of the fix we've changed the location of the R extension's `user.properties` file.  Because of that there will be a couple steps to get things working again:

First, install the update for the R extension through the extension manager: https://ccl.northwestern.edu/netlogo/docs/extension-manager.html  If you have changes from workarounds you've tried in the `extensions` or `.bundled` folder of the NetLogo application, it's probably best to remove them first.

Then add your `user.properties` file in your user-specific R extension folder.  See the docs for the locations, based on your operating system:  https://github.com/NetLogo/R-Extension#configuring-the-r-extension  The R extension should also provide you the location in the error message it generates if it can't find the file when you try to load it in NetLogo.

For Windows users there are a few more steps to consider:
If after making those updates and changes things still aren't working, feel free to email us at bu...@ccl.northwestern.edu and we'll see if we can help you out.

Thanks!

-Jeremy

Charles Staelin

unread,
Jul 24, 2019, 5:45:22 PM7/24/19
to netlogo-users
Many, many thanks to Jeremy for so quickly addressing this problem.  I have just one thing to add, which may be obvious when you go looking.  In Windows 10 at least, the user.properties file should go in  C:\Users\YOUR_USERNAME\AppData\Roaming\NetLogo\6.1\r\  .  Note the addition of "Roaming" to the path.

-------------------------------
Charles P. Staelin
Professor of Economics
Smith College
Northampton, MA 01063


--
You received this message because you are subscribed to a topic in the Google Groups "netlogo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netlogo-users/Uc3hygT0drk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/a5102877-e3c7-4e0c-84f6-cf687b1e654b%40googlegroups.com.

Laszlo Gulyas

unread,
Aug 2, 2019, 5:46:21 AM8/2/19
to netlogo-users
Let me join in, even if belatedly. Much thanks to Jeremy for his quick actions.

Best regards,
-- Laszlo


On Wednesday, July 24, 2019 at 11:45:22 PM UTC+2, Charles Staelin wrote:
Many, many thanks to Jeremy for so quickly addressing this problem.  I have just one thing to add, which may be obvious when you go looking.  In Windows 10 at least, the user.properties file should go in  C:\Users\YOUR_USERNAME\AppData\Roaming\NetLogo\6.1\r\  .  Note the addition of "Roaming" to the path.

-------------------------------
Charles P. Staelin
Professor of Economics
Smith College
Northampton, MA 01063


On Wed, Jul 24, 2019 at 5:10 PM Jeremy Baker <jerem...@northwestern.edu> wrote:
Hey everyone.

There was a bug, as pointed out by Harry and verified by others, in the version of the R extension that shipped with NetLogo 6.1.0.  I believe we have this corrected, but as part of the fix we've changed the location of the R extension's `user.properties` file.  Because of that there will be a couple steps to get things working again:

First, install the update for the R extension through the extension manager: https://ccl.northwestern.edu/netlogo/docs/extension-manager.html  If you have changes from workarounds you've tried in the `extensions` or `.bundled` folder of the NetLogo application, it's probably best to remove them first.

Then add your `user.properties` file in your user-specific R extension folder.  See the docs for the locations, based on your operating system:  https://github.com/NetLogo/R-Extension#configuring-the-r-extension  The R extension should also provide you the location in the error message it generates if it can't find the file when you try to load it in NetLogo.

For Windows users there are a few more steps to consider:
If after making those updates and changes things still aren't working, feel free to email us at bu...@ccl.northwestern.edu and we'll see if we can help you out.

Thanks!

-Jeremy

--
You received this message because you are subscribed to a topic in the Google Groups "netlogo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netlogo-users/Uc3hygT0drk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netlog...@googlegroups.com.

Laszlo Gulyas

unread,
Aug 21, 2019, 12:03:36 PM8/21/19
to netlogo-users
Dear All,

Follow ups to the previous thread:

1) My installation on Windows10 works like a charm. However, when I am doing some BehaviorSpace experiments with the model using the R-extension, sometimes, I observe a crash (the experiment terminates). My hunch is that this may be connected to BehaviorSpace using multiple cores in parallel and R (or the R-bridge) not being able to handle that properly. 

For now, I am doing my experiments using only 1 core and things seem to go fine this way. Anyone has a similar experience or some background info about this?


2) My co-author uses earlier versions of Windows (Win8.1 and Win7 professional on two separate computers). We are having difficulty to get the R extension working on those OSs. 

The base works -- the exension is registered fine with 'extensions [r]'. An interactive panel can also be launched and basic r:eval("....") commands also seem to work. However, when trying to load user libraries in R (evaluating the 'library()' command), the extension throws an error message: "unable to load shared object C:/Program Files/R/R-3.6.1/library/stats/lib/x64/stats.dll".

Anyone has a suggestion about this? 

I know the R-Extension was not tested on these OSs, but I also noticed that a while ago there was a thread about this error message somehow being connected to access issues. 

Any help will be appreciated.

Best regards,

-- Laszlo

gunnar....@gmail.com

unread,
Sep 5, 2019, 1:22:04 PM9/5/19
to netlogo-users
Dear Laszlo,

I've had this problem before, and in my case it was related to the PATH environment variable not being set correctly - I've posted a more detailed explanation & solution here: 


I hope this solution applies to your co-authors, too!

Best regards,
Gunnar

Laszlo Gulyas

unread,
Sep 6, 2019, 3:10:35 AM9/6/19
to gunnar....@gmail.com, netlogo-users
Thank 3, Gunnar. 
We will check it out.

Best,
Laszlo


You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/9ab32a57-8968-422b-9ea9-2313f961b98a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages