Hello MIRO-experts,
I just started to play around with GAMS MIRO and I currently try to build my own custom widget. Sadly, I’m not able to make the R package “sf” usable. As described in the documentation, I added the R package to the json file:
“result”: {
“outType”: “mymap”,
“packages”: [“leaflet”, “sf”]
}
and I reference the function with the package name and double colon within my R file:
polygonsSF = sf::st_read(myfilename, stringsAsFactors=FALSE)
However, I receive the following error message when trying to start MIRO:
Error message: Error in loadNamespace(name): es gibt kein Paket namens ‘sf’
Interestingly, the R package “leaflet” does not make any problems, although I found the sf-package in my .miro-folder, and the leaflet-package not.
Am I doing something wrong or may this be a bug?
Thanks in advance for any help!
Update 29.01.21: I found the problem myself: The loaded R package may only be used inside the two specified functions (mynameOutput and renderMyname) and not in the whole R script.