Skip to content

Error #02 #26

@user-amcc

Description

@user-amcc

Hi,
I am having some issues getting the R extension to work. I am using:
Netlogo 6.2.2
RStudio (R 4.1.2)
Java 1.8.0_321
Windows 10 (64bit)

I wish to use the R extension and so I have followed the instructions for the user.properties. I have set them as follows:
r.home=C:/Program Files/R/R-4.1.2
jri.home.paths=C:/Users/username/Documents/R/win-library/4.1/rJava/jri
r.lib.paths=C:/Users/username/Documents/R/win-library/4.1

I have added the path under advanced system settings as required (https://ccl.northwestern.edu/netlogo/6.0/docs/r.html#windows-specific-installation-steps).

My R code is taken from RNetLogo as follows:

#libraries
library(rJava)#NetLogo runs on Java
library(JavaGD)
library(CommonJavaJars)
library(RNetLogo)#Our simulation package
library(parallel)#for parallelisation

nl.path <- "C:/Program Files/NetLogo 6.2.2/app"

NLStart(nl.path, gui=TRUE, nl.jarname='netlogo-6.2.2.jar')

I get the following but a NetLogo window opens:
Unable to locate empty model: /system/empty.nlogo

When I 'check' extension [r] in NetLogo I get:
Error #2: Cannot find rJava/JRI. The R Extension was unable to locate your installation of rJava

I am a little confused as when I save my users.profiles (as specified above) in the following location:
C:/Users/username/AppData/Roaming/NetLogo/6.2/r
I get:
Exception in thread "Thread-3" java.lang.OutOfMemoryError: Java heap space

Note, I have not loaded any model and it is on some kind of loop as it continuously sends this message until I quit RStudio.
I also tried changing the the .cfg file's [JVMOptions] but this did not help.

I have tried another solution related to the JGR package in R but still no joy with using the extensions [r] command in Netlogo.

Any guidance is greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions