Running r-grass examples when building a R package
Bernardo Santos via grass-stats <[email protected]> Fri, 26 Aug 2022 10:56:22 +0000 (UTC)
| Newsgroups | gmane.comp.gis.grass.stats,gmane.comp.gis.grass.user |
|---|---|
| Message-ID | <[email protected]> |
--===============0650069873312921747==
Content-Type: multipart/alternative;
boundary="----=_Part_146668_395793996.1661511382251"
------=_Part_146668_395793996.1661511382251
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Dear all,
I am building a R package and some of the functions use rgrass to connect t=
o 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 w=
hen I push new commits all the examples of R functions are run again and th=
e webpage is updated with the results of the examples. Here is the webpage:=
=C2=A0https://ninanor.github.io/oneimpact/
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("grass78 --config path", intern =3D T)to find the GRASS folder and u=
se 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 hint=
s to solve it?Is there a recommended way to make sure Github actions know w=
here GRASS is and use it?
BestBernardo
------=_Part_146668_395793996.1661511382251
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div class=3D"yahoo-style-wrap" style=3D"font-fami=
ly:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div dir=
=3D"ltr" data-setdir=3D"false">Dear all,</div><div dir=3D"ltr" data-setdir=
=3D"false"><br></div><div dir=3D"ltr" data-setdir=3D"false">I am building a=
R package and some of the functions use rgrass to connect to a GRASS proje=
ct and run thingfs within GRASS.</div><div dir=3D"ltr" data-setdir=3D"false=
">I have now set up a webpage for the package using pkgdown in integrated t=
o 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: <a href=3D"https://ninanor.github.io/on=
eimpact/" rel=3D"nofollow" target=3D"_blank">https://ninanor.github.io/onei=
mpact/</a></div><div dir=3D"ltr" data-setdir=3D"false"><br></div><div dir=
=3D"ltr" data-setdir=3D"false">All works fine, except the functions calling=
GRASS. When I run the examples form my local computer everything works, bu=
t in the Github actions it does not run, apparently because the command</di=
v><div dir=3D"ltr" data-setdir=3D"false"><br></div><div dir=3D"ltr" data-se=
tdir=3D"false"><span><pre class=3D"ydpa6a6511esourceCode ydpa6a6511er" styl=
e=3D"font-size: 0.875em; direction: ltr; unicode-bidi: bidi-override; margi=
n-top: 0px; color: rgb(0, 0, 0); background-color: rgb(241, 243, 245); bord=
er: 1px solid rgb(222, 226, 230);"><code style=3D"font-size: inherit; direc=
tion: ltr; unicode-bidi: bidi-override; color: rgb(0, 59, 79); background: =
transparent; padding: 0px;"><span class=3D"ydpa6a6511er-in"><span><span cla=
ss=3D"ydpa6a6511efu" style=3D"color: rgb(71, 88, 171);"><a href=3D"https://=
rdrr.io/r/base/system.html" class=3D"ydpa6a6511eexternal-link" style=3D"col=
or: inherit; text-decoration-line: underline; text-decoration-color: rgb(10=
8, 117, 125);" rel=3D"nofollow" target=3D"_blank">system</a></span><span cl=
ass=3D"ydpa6a6511eop" style=3D"color: rgb(94, 94, 94);">(</span><span class=
=3D"ydpa6a6511est" style=3D"color: rgb(32, 121, 77);">"grass78 --config pat=
h"</span>, intern <span class=3D"ydpa6a6511eop" style=3D"color: rgb(94, 94,=
94);">=3D</span> <span class=3D"ydpa6a6511ecn" style=3D"color: rgb(143, 89=
, 2);">T</span><span class=3D"ydpa6a6511eop" style=3D"color: rgb(94, 94, 94=
);">)</span></span></span></code></pre></span>to find the GRASS folder and =
use within rgrass::initGRASS does not work, so the connection between R and=
GRASS do not exist.</div><div dir=3D"ltr" data-setdir=3D"false"><br></div>=
<div dir=3D"ltr" data-setdir=3D"false">Does someone in the group has experi=
ence with that and could help with hints to solve it?</div><div dir=3D"ltr"=
data-setdir=3D"false">Is there a recommended way to make sure Github actio=
ns know where GRASS is and use it?</div><div dir=3D"ltr" data-setdir=3D"fal=
se"><br></div><div dir=3D"ltr" data-setdir=3D"false">Best</div><div dir=3D"=
ltr" data-setdir=3D"false">Bernardo</div></div></body></html>
------=_Part_146668_395793996.1661511382251--
--===============0650069873312921747==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline