[GRASS-stats] Running r-grass examples when building a R package

Roger Bivand Roger.Bivand at nhh.no
Fri Aug 26 04:09:56 PDT 2022


Please also see
https://github.com/rsbivand/rgrass/issues/64 and perhaps give more context - is this the public github repo
https://github.com/NINAnor/oneimpact/ ?

Roger

---
Roger Bivand
Emeritus Professor
Department of Economics
Norwegian School of Economics, Bergen, Norway

________________________________
Fra: grass-stats <grass-stats-bounces at lists.osgeo.org> på vegne av Bernardo Santos via grass-stats <grass-stats at lists.osgeo.org>
Sendt: fredag 26. august 2022, 12:56
Til: grass-stats at lists.osgeo.org <grass-stats at lists.osgeo.org>; GRASS User List <grass-user at lists.osgeo.org>
Emne: [GRASS-stats] Running r-grass examples when building a R package

Dear all,

I am building a R package and some of the functions use rgrass to connect to a GRASS project and run thingfs within GRASS.
I have now set up a webpage for the package using pkgdown in integrated to Github actions. This means when I push new commits all the examples of R functions are run again and the webpage is updated with the results of the examples. Here is the webpage: https://ninanor.github.io/oneimpact/<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fninanor.github.io%2Foneimpact%2F&data=05%7C01%7Croger.bivand%40nhh.no%7C9ee806160e144928a19908da8751a4d1%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C637971081981258278%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DGuKqYQDHFgwT3qY%2BjzglZF1mboRdv2fx7ETXdmYRJ0%3D&reserved=0>

All works fine, except the functions calling GRASS. When I run the examples form my local computer everything works, but in the Github actions it does not run, apparently because the command


system<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Frdrr.io%2Fr%2Fbase%2Fsystem.html&data=05%7C01%7Croger.bivand%40nhh.no%7C9ee806160e144928a19908da8751a4d1%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C637971081981258278%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PWx9f7SSQY6EQn2nPNsCFAdIjT3hp3T6Kk7S9%2BAKnDs%3D&reserved=0>("grass78 --config path", intern = T)

to find the GRASS folder and use within rgrass::initGRASS does not work, so the connection between R and GRASS do not exist.

Does someone in the group has experience with that and could help with hints to solve it?
Is there a recommended way to make sure Github actions know where GRASS is and use it?

Best
Bernardo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-stats/attachments/20220826/0c12e948/attachment.htm>


More information about the grass-stats mailing list