After installing R, run the following command on the terminal:
$sudo R CMD javareconf
install.packages("rJava")
install.packages("igraph")
R.home(component = "home")
[1] "/usr/lib/R"
system.file("jri", package = "rJava")
[1] "/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.5/rJava/jri"
export R_HOME=/usr/lib/R
export JRI_HOME=/home/dvgodoy/R/x86_64-pc-linux-gnu-library/3.5/rJava/jri
https://ccl.northwestern.edu/netlogo/5.0.5/netlogo-5.0.5.tar.gz
tar -xvzf netlogo-5.0.5.tar.gz
https://sourceforge.net/projects/r-ext/files/
Unzip into your NetLogo folder, subfolder extensions
Run NetLogo with netlogo.sh
.
In the code tab, type:
extensions [r]
And click the "check" button. It shouldn't raise any errors.
Open r_functions.nls
.
On r-load
procedure, edit source('functions.R')
to source('/path/to/folder/functions.R')