Hi Liv,
Are you using Linux? I had a similar problem when using the R-Extension in Linux (the same does not happen in Windows). I think it is related to a compatibility problem between R-Extension and the latest versions of R. I was able to solve the problem by using an older version of R (R 3.4.4). I hope this solves your problem.
Does anyone know if this extension continues to be maintained and updated?
Regards,
Tiago Mendes
--
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/d0ce5312-ba15-4017-b073-aef51c775f83n%40googlegroups.com.
Hi,
The NetLogo Development team intends to keep the R-extension working.
I did a successful basic test on Windows, MacOS and Ubuntu with R 4.0.3 before we released NetLogo 6.2.0.
I tried a modified version of the “Homerange example of R-extension”
;; Homerange example of R-extension
;;
;;
;; by Jan C. Thiele
;; University of Goettingen, Germany
;; Department Ecoinformatics, Biometrics and Forest Growth
;; Buesgenweg 4
;; 37077 Goettingen
;; Germany
;;
;; Contact: jth...@gwdg.de
;;
;; Copyright: 2011, J.C. Thiele
In MacOS I was able to
r:eval "library(ade4)"
r:eval "library(adehabitatHR)"
r:eval "library(adehabitatHS)"
r:eval "library(adehabitatLT)"
r:eval "library(adehabitatMA)"
However at the line
r:eval "homerange <- mcp(xy, id)"
I got the following error.
Extension exception: Error in R-Extension: Error in Eval:
org.nlogo.api.ExtensionException: Error in mcp(xy, id) : xy should be of class SpatialPoints
error while observer running R:EVAL
called by procedure CALC-HOMERANGE
called by Button 'calc-homerange'
It appears that the interface to mpc may have changed.
Do either of you have an example of a program that works in R 4.0 but doesn’t work when translated in NetLogo with the R Extension?
Thanks,
Aaron
--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling
To view this discussion on the web visit
https://groups.google.com/d/msgid/netlogo-users/03935f7f-ce51-49a3-babe-f91946fc5b62n%40googlegroups.com.
Hi Aaron,
My problem is when trying to load some pckages, like "adegenet" in newer versions of R, which can't load the "units" dependency, with the following error:
library(units)
Error: package or namespace load failed for ‘units’:
.onLoad failed in loadNamespace() for 'units', details:
call: udunits_init(file.path(.get_ud_xml_dir(), "udunits2.xml"))
error: Error in function udunits_init: Error parsing unit specification
I have the this same error with NetLogo versions 6.1.1 and 6.2.0. However, this error does not occur if you use an older version of R, such as R 3.4.4. This only happens when I run the model on Linux platforms, on Windows it runs perfectly.
Let me know if you need more information.
Thanks ,
Tiago Mendes
Hi,
It would be helpful if you could both create two simple test files that demonstrate the issues you are encountering.
Please run the NetLogo programs using NetLogo 6.2.0, which is our current version. I doubt there are any differences from 6.1.1 that are causing the problem, and we update only the most recent NetLogo and its extensions. Please send us your System Info, which is available by using the NetLogo->About NetLogo menu item (Could also be under Help->About NetLogo) and clicking on the System Tab.
Please specify which version of R it doesn’t work on (e.g. 4.0.3) , as well as a version on which it works (for example R 3.4.4. ). You can capture information using the sessionInfo() command in R.
If a program works on 4.0.3 and not 4.0.5 this may be more of an R issue.
Please also look over the documentation of the R packages involved, or on R forums to find out if there are known issues with these packages.
That will all help us debug the problem at the NetLogo end.
To view this discussion on the web visit
https://groups.google.com/d/msgid/netlogo-users/PR2PR03MB53727E2143DB84AE0152996DAA579%40PR2PR03MB5372.eurprd03.prod.outlook.com.