Simple R extension for NetLogo

299 views
Skip to first unread message

jeremy...@northwestern.edu

unread,
Jul 8, 2022, 1:28:37 PM7/8/22
to netlogo-users
Hello NetLogo users!

I'm pleased to announce the availability of the Simple R Extension.  It allows running R code from a NetLogo model with a simple point and click configuration menu for telling the extension about the location on your system of your R install.  This extension was made possible by the hard work of a Northwestern University undergraduate student James Hovet.

You can install the extension through the NetLogo extensions manager.  Check out the docs to get started:  https://github.com/NetLogo/SimpleR-Extension/blob/main/README.md#using

Why a new R extension?  The existing R Extension that comes bundled with NetLogo is tricky to setup, involving a Java install, a Java package for R, and manually creating configuration files to tie them all together.  This new Simple R extension can be set up from within NetLogo using a configuration menu.  The Simple R Extension has most of the features of the bundled version, the documentation for the extension has more info on the differences:  https://github.com/NetLogo/SimpleR-Extension/blob/main/README.md#transitioning-from-the-old-r-extension  The bundled R Extension isn't going anywhere anytime soon, so feel free to continue using that if you've got it set up and you need a feature it provides that the Simple R Extension does not yet.

Feel free to give it a try and see if it will work for your use cases.  You can leave feedback here or send it privately to feed...@ccl.northwestern.edu 

Thanks.

-Jeremy

Wade Schuette

unread,
Jul 8, 2022, 2:13:32 PM7/8/22
to netlogo-users
Thanks, Jeremy!  This will be very useful!
I tried your instructions and it worked!

Two side comments for users:

(1) If you are new to R,  and you haven't looked at RStudio, consider getting it --- it's a huge help!
      See https://rstudio-education.github.io/hopr/starting.html  for instructions for all platforms.

(2) If you some day want to use R to make system calls ( to your operating system )
     consider using the processX package.  https://ropensci.org/blog/2021/09/13/system-calls-r-package/

     Then this works:    show sr:runresult "processx::run('whoami')"

Wade

--
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/145e6ab8-a2c1-4070-8249-902b3a261a7bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages